From 2953a19861a11ada906397fb47e705f6095d1d2c Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 17 Aug 2022 20:04:35 +0000 Subject: [PATCH] CodeGen from PR 19296 in Azure/azure-rest-api-specs Merge 7f688388786206750f3ec90a8749471ed6b9874f into 2614c5038cb384e864c1608e76be61a5ee84cb02 --- eng/versioning/version_client.txt | 1 + pom.xml | 3 +- .../CHANGELOG.md | 5 + .../README.md | 102 ++ .../SAMPLE.md | 903 ++++++++++++++++ .../pom.xml | 55 + .../generated/AuthorizationManager.java | 710 +++++++++++++ ...ReviewDefaultSettingsOperationsClient.java | 66 ++ ...eviewHistoryDefinitionInstancesClient.java | 47 + ...ryDefinitionInstancesOperationsClient.java | 44 + ...viewHistoryDefinitionOperationsClient.java | 71 ++ .../AccessReviewHistoryDefinitionsClient.java | 66 ++ ...eviewInstanceContactedReviewersClient.java | 44 + .../AccessReviewInstanceDecisionsClient.java | 45 + ...AccessReviewInstanceMyDecisionsClient.java | 114 +++ .../AccessReviewInstanceOperationsClient.java | 143 +++ ...InstancesAssignedForMyApprovalsClient.java | 73 ++ .../fluent/AccessReviewInstancesClient.java | 101 ++ ...finitionsAssignedForMyApprovalsClient.java | 42 + ...AccessReviewScheduleDefinitionsClient.java | 143 +++ .../fluent/AuthorizationManagementClient.java | 223 ++++ .../generated/fluent/OperationsClient.java | 38 + ...copeAccessReviewDefaultSettingsClient.java | 70 ++ ...eviewHistoryDefinitionInstancesClient.java | 49 + ...ryDefinitionInstancesOperationsClient.java | 46 + ...viewHistoryDefinitionOperationsClient.java | 75 ++ ...eAccessReviewHistoryDefinitionsClient.java | 74 ++ ...eviewInstanceContactedReviewersClient.java | 47 + ...peAccessReviewInstanceDecisionsClient.java | 49 + ...eAccessReviewInstanceOperationsClient.java | 160 +++ .../ScopeAccessReviewInstancesClient.java | 114 +++ ...AccessReviewScheduleDefinitionsClient.java | 161 +++ ...eviewInstanceContactedReviewersClient.java | 44 + .../models/AccessReviewActorIdentity.java | 81 ++ .../AccessReviewContactedReviewerInner.java | 67 ++ ...cessReviewContactedReviewerProperties.java | 66 ++ .../models/AccessReviewDecisionIdentity.java | 65 ++ .../models/AccessReviewDecisionInner.java | 285 ++++++ ...AccessReviewDecisionInsightProperties.java | 48 + ...ewDecisionPrincipalResourceMembership.java | 55 + .../AccessReviewDecisionProperties.java | 426 ++++++++ .../models/AccessReviewDecisionResource.java | 86 ++ .../AccessReviewDefaultSettingsInner.java | 423 ++++++++ .../AccessReviewHistoryDefinitionInner.java | 361 +++++++ ...cessReviewHistoryDefinitionProperties.java | 425 ++++++++ .../AccessReviewHistoryInstanceInner.java | 207 ++++ ...AccessReviewHistoryInstanceProperties.java | 223 ++++ .../AccessReviewHistoryScheduleSettings.java | 203 ++++ .../models/AccessReviewInstanceInner.java | 156 +++ .../AccessReviewInstanceProperties.java | 169 +++ .../models/AccessReviewRecurrencePattern.java | 75 ++ .../models/AccessReviewRecurrenceRange.java | 130 +++ .../AccessReviewRecurrenceSettings.java | 203 ++++ .../AccessReviewScheduleDefinitionInner.java | 720 +++++++++++++ ...essReviewScheduleDefinitionProperties.java | 885 ++++++++++++++++ .../models/AccessReviewScheduleSettings.java | 452 ++++++++ .../fluent/models/AccessReviewScope.java | 245 +++++ .../fluent/models/OperationInner.java | 128 +++ .../generated/fluent/models/package-info.java | 9 + .../generated/fluent/package-info.java | 9 + .../AccessReviewContactedReviewerImpl.java | 54 + .../AccessReviewDecisionImpl.java | 145 +++ .../AccessReviewDefaultSettingsImpl.java | 106 ++ ...ewDefaultSettingsOperationsClientImpl.java | 329 ++++++ ...ssReviewDefaultSettingsOperationsImpl.java | 83 ++ .../AccessReviewHistoryDefinitionImpl.java | 230 +++++ ...wHistoryDefinitionInstancesClientImpl.java | 227 +++++ ...sReviewHistoryDefinitionInstancesImpl.java | 62 ++ ...finitionInstancesOperationsClientImpl.java | 334 ++++++ ...toryDefinitionInstancesOperationsImpl.java | 48 + ...HistoryDefinitionOperationsClientImpl.java | 366 +++++++ ...ReviewHistoryDefinitionOperationsImpl.java | 46 + ...essReviewHistoryDefinitionsClientImpl.java | 482 +++++++++ .../AccessReviewHistoryDefinitionsImpl.java | 71 ++ .../AccessReviewHistoryInstanceImpl.java | 75 ++ ...wInstanceContactedReviewersClientImpl.java | 349 +++++++ ...sReviewInstanceContactedReviewersImpl.java | 47 + ...cessReviewInstanceDecisionsClientImpl.java | 380 +++++++ .../AccessReviewInstanceDecisionsImpl.java | 48 + .../AccessReviewInstanceImpl.java | 162 +++ ...ssReviewInstanceMyDecisionsClientImpl.java | 710 +++++++++++++ .../AccessReviewInstanceMyDecisionsImpl.java | 104 ++ ...essReviewInstanceOperationsClientImpl.java | 801 +++++++++++++++ .../AccessReviewInstanceOperationsImpl.java | 74 ++ ...ancesAssignedForMyApprovalsClientImpl.java | 479 +++++++++ ...ewInstancesAssignedForMyApprovalsImpl.java | 73 ++ .../AccessReviewInstancesClientImpl.java | 693 +++++++++++++ .../AccessReviewInstancesImpl.java | 76 ++ .../AccessReviewScheduleDefinitionImpl.java | 535 ++++++++++ ...tionsAssignedForMyApprovalsClientImpl.java | 316 ++++++ ...DefinitionsAssignedForMyApprovalsImpl.java | 48 + ...ssReviewScheduleDefinitionsClientImpl.java | 922 +++++++++++++++++ .../AccessReviewScheduleDefinitionsImpl.java | 91 ++ .../AuthorizationManagementClientBuilder.java | 144 +++ .../AuthorizationManagementClientImpl.java | 642 ++++++++++++ .../implementation/OperationImpl.java | 46 + .../implementation/OperationsClientImpl.java | 276 +++++ .../implementation/OperationsImpl.java | 46 + ...AccessReviewDefaultSettingsClientImpl.java | 303 ++++++ .../ScopeAccessReviewDefaultSettingsImpl.java | 84 ++ ...wHistoryDefinitionInstancesClientImpl.java | 228 +++++ ...sReviewHistoryDefinitionInstancesImpl.java | 64 ++ ...finitionInstancesOperationsClientImpl.java | 330 ++++++ ...toryDefinitionInstancesOperationsImpl.java | 49 + ...HistoryDefinitionOperationsClientImpl.java | 357 +++++++ ...ReviewHistoryDefinitionOperationsImpl.java | 72 ++ ...essReviewHistoryDefinitionsClientImpl.java | 468 +++++++++ ...opeAccessReviewHistoryDefinitionsImpl.java | 72 ++ ...wInstanceContactedReviewersClientImpl.java | 352 +++++++ ...sReviewInstanceContactedReviewersImpl.java | 50 + ...cessReviewInstanceDecisionsClientImpl.java | 386 +++++++ ...copeAccessReviewInstanceDecisionsImpl.java | 48 + ...essReviewInstanceOperationsClientImpl.java | 855 ++++++++++++++++ ...opeAccessReviewInstanceOperationsImpl.java | 86 ++ .../ScopeAccessReviewInstancesClientImpl.java | 706 +++++++++++++ .../ScopeAccessReviewInstancesImpl.java | 104 ++ ...ssReviewScheduleDefinitionsClientImpl.java | 897 ++++++++++++++++ ...peAccessReviewScheduleDefinitionsImpl.java | 118 +++ ...wInstanceContactedReviewersClientImpl.java | 329 ++++++ ...sReviewInstanceContactedReviewersImpl.java | 49 + .../generated/implementation/Utils.java | 204 ++++ .../implementation/package-info.java | 9 + .../models/AccessRecommendationType.java | 41 + .../models/AccessReviewActorIdentityType.java | 38 + .../models/AccessReviewApplyResult.java | 51 + .../models/AccessReviewContactedReviewer.java | 61 ++ ...cessReviewContactedReviewerListResult.java | 77 ++ .../models/AccessReviewDecision.java | 190 ++++ .../models/AccessReviewDecisionInsight.java | 49 + .../AccessReviewDecisionInsightType.java | 35 + .../AccessReviewDecisionListResult.java | 77 ++ ...cisionPrincipalResourceMembershipType.java | 39 + ...eviewDecisionServicePrincipalIdentity.java | 42 + .../AccessReviewDecisionUserIdentity.java | 42 + ...ewDecisionUserSignInInsightProperties.java | 42 + .../models/AccessReviewDefaultSettings.java | 162 +++ ...AccessReviewDefaultSettingsOperations.java | 55 + .../models/AccessReviewHistoryDefinition.java | 330 ++++++ ...ewHistoryDefinitionInstanceListResult.java | 77 ++ ...ccessReviewHistoryDefinitionInstances.java | 39 + ...wHistoryDefinitionInstancesOperations.java | 36 + ...cessReviewHistoryDefinitionListResult.java | 77 ++ ...cessReviewHistoryDefinitionOperations.java | 41 + .../AccessReviewHistoryDefinitionStatus.java | 48 + .../AccessReviewHistoryDefinitions.java | 59 ++ .../models/AccessReviewHistoryInstance.java | 102 ++ .../models/AccessReviewInstance.java | 184 ++++ ...ccessReviewInstanceContactedReviewers.java | 36 + .../models/AccessReviewInstanceDecisions.java | 39 + .../AccessReviewInstanceListResult.java | 77 ++ .../AccessReviewInstanceMyDecisions.java | 104 ++ .../AccessReviewInstanceOperations.java | 131 +++ .../AccessReviewInstanceReviewersType.java | 45 + .../models/AccessReviewInstanceStatus.java | 65 ++ .../models/AccessReviewInstances.java | 71 ++ ...ReviewInstancesAssignedForMyApprovals.java | 63 ++ .../AccessReviewRecurrencePatternType.java | 38 + .../AccessReviewRecurrenceRangeType.java | 41 + .../generated/models/AccessReviewResult.java | 47 + .../models/AccessReviewReviewer.java | 61 ++ .../models/AccessReviewReviewerType.java | 38 + .../AccessReviewScheduleDefinition.java | 964 ++++++++++++++++++ ...essReviewScheduleDefinitionListResult.java | 77 ++ ...ReviewScheduleDefinitionReviewersType.java | 46 + .../AccessReviewScheduleDefinitionStatus.java | 66 ++ .../AccessReviewScheduleDefinitions.java | 110 ++ ...duleDefinitionsAssignedForMyApprovals.java | 34 + .../AccessReviewScopeAssignmentState.java | 38 + .../AccessReviewScopePrincipalType.java | 47 + .../models/DecisionResourceType.java | 35 + .../generated/models/DecisionTargetType.java | 38 + .../generated/models/DefaultDecisionType.java | 41 + .../generated/models/Operation.java | 45 + .../generated/models/OperationDisplay.java | 80 ++ .../generated/models/OperationListResult.java | 77 ++ .../generated/models/Operations.java | 33 + .../models/RecordAllDecisionsProperties.java | 102 ++ .../models/RecordAllDecisionsResult.java | 38 + .../ScopeAccessReviewDefaultSettings.java | 61 ++ ...ccessReviewHistoryDefinitionInstances.java | 41 + ...wHistoryDefinitionInstancesOperations.java | 38 + ...cessReviewHistoryDefinitionOperations.java | 65 ++ .../ScopeAccessReviewHistoryDefinitions.java | 65 ++ ...ccessReviewInstanceContactedReviewers.java | 39 + .../ScopeAccessReviewInstanceDecisions.java | 42 + .../ScopeAccessReviewInstanceOperations.java | 145 +++ .../models/ScopeAccessReviewInstances.java | 104 ++ .../ScopeAccessReviewScheduleDefinitions.java | 145 +++ ...ccessReviewInstanceContactedReviewers.java | 36 + .../generated/models/package-info.java | 9 + .../authorization/generated/package-info.java | 9 + .../src/main/java/module-info.java | 19 + ...viewInstanceMyDecisionsGetByIdSamples.java | 29 + ...sReviewInstanceMyDecisionsListSamples.java | 25 + ...ReviewInstanceMyDecisionsPatchSamples.java | 31 + ...OperationAcceptRecommendationsSamples.java | 25 + ...esAssignedForMyApprovalGetByIdSamples.java | 26 + ...ancesAssignedForMyApprovalListSamples.java | 25 + ...tionsAssignedForMyApprovalListSamples.java | 23 + ...AccessReviewDefaultSettingsGetSamples.java | 25 + ...AccessReviewDefaultSettingsPutSamples.java | 27 + ...ionInstanceGenerateDownloadUriSamples.java | 29 + ...finitionInstancesOperationListSamples.java | 28 + ...storyDefinitionOperationCreateSamples.java | 30 + ...yDefinitionOperationDeleteByIdSamples.java | 28 + ...eviewHistoryDefinitionsGetByIdSamples.java | 28 + ...ssReviewHistoryDefinitionsListSamples.java | 25 + ...InstanceContactedReviewersListSamples.java | 29 + ...essReviewInstanceDecisionsListSamples.java | 30 + ...nstanceOperationApplyDecisionsSamples.java | 28 + ...nceOperationRecordAllDecisionsSamples.java | 31 + ...nstanceOperationResetDecisionsSamples.java | 28 + ...InstanceOperationSendRemindersSamples.java | 28 + ...essReviewInstanceOperationStopSamples.java | 28 + ...opeAccessReviewInstancesCreateSamples.java | 31 + ...peAccessReviewInstancesGetByIdSamples.java | 29 + ...ScopeAccessReviewInstancesListSamples.java | 29 + ...eDefinitionsCreateOrUpdateByIdSamples.java | 29 + ...wScheduleDefinitionsDeleteByIdSamples.java | 28 + ...viewScheduleDefinitionsGetByIdSamples.java | 27 + ...sReviewScheduleDefinitionsListSamples.java | 25 + ...sReviewScheduleDefinitionsStopSamples.java | 27 + ...InstanceContactedReviewersListSamples.java | 25 + sdk/authorization/ci.yml | 47 + sdk/authorization/pom.xml | 15 + 225 files changed, 32526 insertions(+), 1 deletion(-) create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/CHANGELOG.md create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/README.md create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/SAMPLE.md create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/pom.xml create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/AuthorizationManager.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewDefaultSettingsOperationsClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewHistoryDefinitionInstancesClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewHistoryDefinitionInstancesOperationsClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewHistoryDefinitionOperationsClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewHistoryDefinitionsClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewInstanceContactedReviewersClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewInstanceDecisionsClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewInstanceMyDecisionsClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewInstanceOperationsClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewInstancesAssignedForMyApprovalsClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewInstancesClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewScheduleDefinitionsAssignedForMyApprovalsClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewScheduleDefinitionsClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AuthorizationManagementClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/OperationsClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewDefaultSettingsClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewHistoryDefinitionInstancesClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewHistoryDefinitionInstancesOperationsClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewHistoryDefinitionOperationsClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewHistoryDefinitionsClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewInstanceContactedReviewersClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewInstanceDecisionsClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewInstanceOperationsClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewInstancesClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewScheduleDefinitionsClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/TenantLevelAccessReviewInstanceContactedReviewersClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewActorIdentity.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewContactedReviewerInner.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewContactedReviewerProperties.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewDecisionIdentity.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewDecisionInner.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewDecisionInsightProperties.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewDecisionPrincipalResourceMembership.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewDecisionProperties.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewDecisionResource.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewDefaultSettingsInner.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewHistoryDefinitionInner.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewHistoryDefinitionProperties.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewHistoryInstanceInner.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewHistoryInstanceProperties.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewHistoryScheduleSettings.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewInstanceInner.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewInstanceProperties.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewRecurrencePattern.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewRecurrenceRange.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewRecurrenceSettings.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewScheduleDefinitionInner.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewScheduleDefinitionProperties.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewScheduleSettings.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewScope.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/OperationInner.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/package-info.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/package-info.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewContactedReviewerImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewDecisionImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewDefaultSettingsImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewDefaultSettingsOperationsClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewDefaultSettingsOperationsImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionInstancesClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionInstancesImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionInstancesOperationsClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionInstancesOperationsImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionOperationsClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionOperationsImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionsClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionsImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryInstanceImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceContactedReviewersClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceContactedReviewersImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceDecisionsClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceDecisionsImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceMyDecisionsClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceMyDecisionsImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceOperationsClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceOperationsImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstancesAssignedForMyApprovalsClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstancesAssignedForMyApprovalsImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstancesClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstancesImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewScheduleDefinitionImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewScheduleDefinitionsAssignedForMyApprovalsClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewScheduleDefinitionsAssignedForMyApprovalsImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewScheduleDefinitionsClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewScheduleDefinitionsImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AuthorizationManagementClientBuilder.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AuthorizationManagementClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/OperationImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/OperationsClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/OperationsImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewDefaultSettingsClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewDefaultSettingsImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewHistoryDefinitionInstancesClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewHistoryDefinitionInstancesImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewHistoryDefinitionInstancesOperationsClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewHistoryDefinitionInstancesOperationsImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewHistoryDefinitionOperationsClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewHistoryDefinitionOperationsImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewHistoryDefinitionsClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewHistoryDefinitionsImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewInstanceContactedReviewersClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewInstanceContactedReviewersImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewInstanceDecisionsClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewInstanceDecisionsImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewInstanceOperationsClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewInstanceOperationsImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewInstancesClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewInstancesImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewScheduleDefinitionsClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewScheduleDefinitionsImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/TenantLevelAccessReviewInstanceContactedReviewersClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/TenantLevelAccessReviewInstanceContactedReviewersImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/Utils.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/package-info.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessRecommendationType.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewActorIdentityType.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewApplyResult.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewContactedReviewer.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewContactedReviewerListResult.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecision.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionInsight.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionInsightType.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionListResult.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionPrincipalResourceMembershipType.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionServicePrincipalIdentity.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionUserIdentity.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionUserSignInInsightProperties.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDefaultSettings.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDefaultSettingsOperations.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryDefinition.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryDefinitionInstanceListResult.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryDefinitionInstances.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryDefinitionInstancesOperations.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryDefinitionListResult.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryDefinitionOperations.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryDefinitionStatus.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryDefinitions.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryInstance.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstance.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstanceContactedReviewers.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstanceDecisions.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstanceListResult.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstanceMyDecisions.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstanceOperations.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstanceReviewersType.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstanceStatus.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstances.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstancesAssignedForMyApprovals.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewRecurrencePatternType.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewRecurrenceRangeType.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewResult.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewReviewer.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewReviewerType.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewScheduleDefinition.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewScheduleDefinitionListResult.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewScheduleDefinitionReviewersType.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewScheduleDefinitionStatus.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewScheduleDefinitions.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewScheduleDefinitionsAssignedForMyApprovals.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewScopeAssignmentState.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewScopePrincipalType.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/DecisionResourceType.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/DecisionTargetType.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/DefaultDecisionType.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/Operation.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/OperationDisplay.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/OperationListResult.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/Operations.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RecordAllDecisionsProperties.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RecordAllDecisionsResult.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewDefaultSettings.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewHistoryDefinitionInstances.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewHistoryDefinitionInstancesOperations.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewHistoryDefinitionOperations.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewHistoryDefinitions.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewInstanceContactedReviewers.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewInstanceDecisions.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewInstanceOperations.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewInstances.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewScheduleDefinitions.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/TenantLevelAccessReviewInstanceContactedReviewers.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/package-info.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/package-info.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/module-info.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AccessReviewInstanceMyDecisionsGetByIdSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AccessReviewInstanceMyDecisionsListSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AccessReviewInstanceMyDecisionsPatchSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AccessReviewInstanceOperationAcceptRecommendationsSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AccessReviewInstancesAssignedForMyApprovalGetByIdSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AccessReviewInstancesAssignedForMyApprovalListSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AccessReviewScheduleDefinitionsAssignedForMyApprovalListSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewDefaultSettingsGetSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewDefaultSettingsPutSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewHistoryDefinitionInstanceGenerateDownloadUriSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewHistoryDefinitionInstancesOperationListSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewHistoryDefinitionOperationCreateSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewHistoryDefinitionOperationDeleteByIdSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewHistoryDefinitionsGetByIdSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewHistoryDefinitionsListSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstanceContactedReviewersListSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstanceDecisionsListSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstanceOperationApplyDecisionsSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstanceOperationRecordAllDecisionsSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstanceOperationResetDecisionsSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstanceOperationSendRemindersSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstanceOperationStopSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstancesCreateSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstancesGetByIdSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstancesListSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewScheduleDefinitionsCreateOrUpdateByIdSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewScheduleDefinitionsDeleteByIdSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewScheduleDefinitionsGetByIdSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewScheduleDefinitionsListSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewScheduleDefinitionsStopSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/TenantLevelAccessReviewInstanceContactedReviewersListSamples.java create mode 100644 sdk/authorization/ci.yml create mode 100644 sdk/authorization/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 86e1c99023118..06110dd2db282 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -362,6 +362,7 @@ com.azure.resourcemanager:azure-resourcemanager-orbital;1.0.0-beta.1;1.0.0-beta. com.azure.resourcemanager:azure-resourcemanager-networkfunction;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-resourceconnector;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-fluidrelay;1.0.0;1.1.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-authorization-generated;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0-beta.1;1.0.0-beta.2 diff --git a/pom.xml b/pom.xml index aa57b9a1692d3..887365bf2f972 100644 --- a/pom.xml +++ b/pom.xml @@ -20,6 +20,7 @@ sdk/appcontainers sdk/applicationinsights sdk/attestation + sdk/authorization sdk/automanage sdk/automation sdk/avs @@ -71,8 +72,8 @@ sdk/eventgrid sdk/eventhubs sdk/extendedlocation - sdk/formrecognizer sdk/fluidrelay + sdk/formrecognizer sdk/frontdoor sdk/hanaonazure sdk/hardwaresecuritymodules diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/CHANGELOG.md b/sdk/authorization/azure-resourcemanager-authorization-generated/CHANGELOG.md new file mode 100644 index 0000000000000..a7eed531810c1 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-08-17) + +- Azure Resource Manager Authorization client library for Java. This package contains Microsoft Azure SDK for Authorization Management SDK. Access reviews service provides the workflow for running access reviews on different kind of resources. Package tag package-2021-12-01-preview-only. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/README.md b/sdk/authorization/azure-resourcemanager-authorization-generated/README.md new file mode 100644 index 0000000000000..4f8f36ec30bd4 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager Authorization client library for Java + +Azure Resource Manager Authorization client library for Java. + +This package contains Microsoft Azure SDK for Authorization Management SDK. Access reviews service provides the workflow for running access reviews on different kind of resources. Package tag package-2021-12-01-preview-only. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-authorization-generated;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-authorization-generated + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, `azure` client can be authenticated by following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +AuthorizationManager manager = AuthorizationManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/authorization/azure-resourcemanager-authorization-generated/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/SAMPLE.md b/sdk/authorization/azure-resourcemanager-authorization-generated/SAMPLE.md new file mode 100644 index 0000000000000..501b734dbb574 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/SAMPLE.md @@ -0,0 +1,903 @@ +# Code snippets and samples + + +## AccessReviewInstanceMyDecisions + +- [GetById](#accessreviewinstancemydecisions_getbyid) +- [List](#accessreviewinstancemydecisions_list) +- [Patch](#accessreviewinstancemydecisions_patch) + +## AccessReviewInstanceOperation + +- [AcceptRecommendations](#accessreviewinstanceoperation_acceptrecommendations) + +## AccessReviewInstancesAssignedForMyApproval + +- [GetById](#accessreviewinstancesassignedformyapproval_getbyid) +- [List](#accessreviewinstancesassignedformyapproval_list) + +## AccessReviewScheduleDefinitionsAssignedForMyApproval + +- [List](#accessreviewscheduledefinitionsassignedformyapproval_list) + +## ScopeAccessReviewDefaultSettings + +- [Get](#scopeaccessreviewdefaultsettings_get) +- [Put](#scopeaccessreviewdefaultsettings_put) + +## ScopeAccessReviewHistoryDefinitionInstance + +- [GenerateDownloadUri](#scopeaccessreviewhistorydefinitioninstance_generatedownloaduri) + +## ScopeAccessReviewHistoryDefinitionInstancesOperation + +- [List](#scopeaccessreviewhistorydefinitioninstancesoperation_list) + +## ScopeAccessReviewHistoryDefinitionOperation + +- [Create](#scopeaccessreviewhistorydefinitionoperation_create) +- [DeleteById](#scopeaccessreviewhistorydefinitionoperation_deletebyid) + +## ScopeAccessReviewHistoryDefinitions + +- [GetById](#scopeaccessreviewhistorydefinitions_getbyid) +- [List](#scopeaccessreviewhistorydefinitions_list) + +## ScopeAccessReviewInstanceContactedReviewers + +- [List](#scopeaccessreviewinstancecontactedreviewers_list) + +## ScopeAccessReviewInstanceDecisions + +- [List](#scopeaccessreviewinstancedecisions_list) + +## ScopeAccessReviewInstanceOperation + +- [ApplyDecisions](#scopeaccessreviewinstanceoperation_applydecisions) +- [RecordAllDecisions](#scopeaccessreviewinstanceoperation_recordalldecisions) +- [ResetDecisions](#scopeaccessreviewinstanceoperation_resetdecisions) +- [SendReminders](#scopeaccessreviewinstanceoperation_sendreminders) +- [Stop](#scopeaccessreviewinstanceoperation_stop) + +## ScopeAccessReviewInstances + +- [Create](#scopeaccessreviewinstances_create) +- [GetById](#scopeaccessreviewinstances_getbyid) +- [List](#scopeaccessreviewinstances_list) + +## ScopeAccessReviewScheduleDefinitions + +- [CreateOrUpdateById](#scopeaccessreviewscheduledefinitions_createorupdatebyid) +- [DeleteById](#scopeaccessreviewscheduledefinitions_deletebyid) +- [GetById](#scopeaccessreviewscheduledefinitions_getbyid) +- [List](#scopeaccessreviewscheduledefinitions_list) +- [Stop](#scopeaccessreviewscheduledefinitions_stop) + +## TenantLevelAccessReviewInstanceContactedReviewers + +- [List](#tenantlevelaccessreviewinstancecontactedreviewers_list) +### AccessReviewInstanceMyDecisions_GetById + +```java +import com.azure.core.util.Context; + +/** Samples for AccessReviewInstanceMyDecisions GetById. */ +public final class AccessReviewInstanceMyDecisionsGetByIdSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/GetAccessReviewInstanceMyDecisionById.json + */ + /** + * Sample code: GetAccessReviews. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReviews( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .accessReviewInstanceMyDecisions() + .getByIdWithResponse( + "488a6d0e-0a63-4946-86e3-1f5bbc934661", + "4135f961-be78-4005-8101-c72a5af307a2", + "fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + Context.NONE); + } +} +``` + +### AccessReviewInstanceMyDecisions_List + +```java +import com.azure.core.util.Context; + +/** Samples for AccessReviewInstanceMyDecisions List. */ +public final class AccessReviewInstanceMyDecisionsListSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/GetAccessReviewInstanceMyDecisions.json + */ + /** + * Sample code: GetAccessReviews. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReviews( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .accessReviewInstanceMyDecisions() + .list("488a6d0e-0a63-4946-86e3-1f5bbc934661", "4135f961-be78-4005-8101-c72a5af307a2", null, Context.NONE); + } +} +``` + +### AccessReviewInstanceMyDecisions_Patch + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewDecisionProperties; + +/** Samples for AccessReviewInstanceMyDecisions Patch. */ +public final class AccessReviewInstanceMyDecisionsPatchSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/PatchAccessReviewInstanceMyDecisionById.json + */ + /** + * Sample code: GetAccessReviews. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReviews( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .accessReviewInstanceMyDecisions() + .patchWithResponse( + "488a6d0e-0a63-4946-86e3-1f5bbc934661", + "4135f961-be78-4005-8101-c72a5af307a2", + "fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + new AccessReviewDecisionProperties(), + Context.NONE); + } +} +``` + +### AccessReviewInstanceOperation_AcceptRecommendations + +```java +import com.azure.core.util.Context; + +/** Samples for AccessReviewInstanceOperation AcceptRecommendations. */ +public final class AccessReviewInstanceOperationAcceptRecommendationsSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/AccessReviewInstanceAcceptRecommendations.json + */ + /** + * Sample code: GetAccessReview. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReview(com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .accessReviewInstanceOperations() + .acceptRecommendationsWithResponse( + "488a6d0e-0a63-4946-86e3-1f5bbc934661", "d9b9e056-7004-470b-bf21-1635e98487da", Context.NONE); + } +} +``` + +### AccessReviewInstancesAssignedForMyApproval_GetById + +```java +import com.azure.core.util.Context; + +/** Samples for AccessReviewInstancesAssignedForMyApproval GetById. */ +public final class AccessReviewInstancesAssignedForMyApprovalGetByIdSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/GetAccessReviewInstanceAssignedForMyApproval.json + */ + /** + * Sample code: GetAccessReviews. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReviews( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .accessReviewInstancesAssignedForMyApprovals() + .getByIdWithResponse( + "488a6d0e-0a63-4946-86e3-1f5bbc934661", "4135f961-be78-4005-8101-c72a5af307a2", Context.NONE); + } +} +``` + +### AccessReviewInstancesAssignedForMyApproval_List + +```java +import com.azure.core.util.Context; + +/** Samples for AccessReviewInstancesAssignedForMyApproval List. */ +public final class AccessReviewInstancesAssignedForMyApprovalListSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/GetAccessReviewInstancesAssignedForMyApproval.json + */ + /** + * Sample code: GetAccessReviews. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReviews( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .accessReviewInstancesAssignedForMyApprovals() + .list("488a6d0e-0a63-4946-86e3-1f5bbc934661", "assignedToMeToReview()", Context.NONE); + } +} +``` + +### AccessReviewScheduleDefinitionsAssignedForMyApproval_List + +```java +import com.azure.core.util.Context; + +/** Samples for AccessReviewScheduleDefinitionsAssignedForMyApproval List. */ +public final class AccessReviewScheduleDefinitionsAssignedForMyApprovalListSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/GetAccessReviewScheduleDefinitionsAssignedForMyApproval.json + */ + /** + * Sample code: GetAccessReviews. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReviews( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager.accessReviewScheduleDefinitionsAssignedForMyApprovals().list("assignedToMeToReview()", Context.NONE); + } +} +``` + +### ScopeAccessReviewDefaultSettings_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ScopeAccessReviewDefaultSettings Get. */ +public final class ScopeAccessReviewDefaultSettingsGetSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/GetAccessReviewDefaultSettings.json + */ + /** + * Sample code: GetAccessReviewDefaultSettings. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReviewDefaultSettings( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewDefaultSettings() + .getWithResponse("subscriptions/fa73e90b-5bf1-45fd-a182-35ce5fc0674d", Context.NONE); + } +} +``` + +### ScopeAccessReviewDefaultSettings_Put + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewScheduleSettings; + +/** Samples for ScopeAccessReviewDefaultSettings Put. */ +public final class ScopeAccessReviewDefaultSettingsPutSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/PutAccessReviewDefaultSettings.json + */ + /** + * Sample code: GetAccessReviewDefaultSettings. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReviewDefaultSettings( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewDefaultSettings() + .putWithResponse( + "subscriptions/fa73e90b-5bf1-45fd-a182-35ce5fc0674d", new AccessReviewScheduleSettings(), Context.NONE); + } +} +``` + +### ScopeAccessReviewHistoryDefinitionInstance_GenerateDownloadUri + +```java +import com.azure.core.util.Context; + +/** Samples for ScopeAccessReviewHistoryDefinitionInstance GenerateDownloadUri. */ +public final class ScopeAccessReviewHistoryDefinitionInstanceGenerateDownloadUriSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/PostAccessReviewHistoryDefinitionInstance.json + */ + /** + * Sample code: PostAccessReviewHistoryDefinitionInstance. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void postAccessReviewHistoryDefinitionInstance( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewHistoryDefinitionInstances() + .generateDownloadUriWithResponse( + "subscriptions/129a304b-4aea-4b86-a9f7-ba7e2b23737a", + "44724910-d7a5-4c29-b28f-db73e717165a", + "9038f4f3-3d8d-43c3-8ede-669ea082c43b", + Context.NONE); + } +} +``` + +### ScopeAccessReviewHistoryDefinitionInstancesOperation_List + +```java +import com.azure.core.util.Context; + +/** Samples for ScopeAccessReviewHistoryDefinitionInstancesOperation List. */ +public final class ScopeAccessReviewHistoryDefinitionInstancesOperationListSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/GetAccessReviewHistoryDefinitionInstances.json + */ + /** + * Sample code: GetAccessReviewHistoryDefinitionInstances. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReviewHistoryDefinitionInstances( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewHistoryDefinitionInstancesOperations() + .list( + "subscriptions/129a304b-4aea-4b86-a9f7-ba7e2b23737a", + "44724910-d7a5-4c29-b28f-db73e717165a", + Context.NONE); + } +} +``` + +### ScopeAccessReviewHistoryDefinitionOperation_Create + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryDefinitionProperties; + +/** Samples for ScopeAccessReviewHistoryDefinitionOperation Create. */ +public final class ScopeAccessReviewHistoryDefinitionOperationCreateSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/PutAccessReviewHistoryDefinition.json + */ + /** + * Sample code: PutAccessReviewHistoryDefinition. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void putAccessReviewHistoryDefinition( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewHistoryDefinitionOperations() + .createWithResponse( + "subscriptions/129a304b-4aea-4b86-a9f7-ba7e2b23737a", + "44724910-d7a5-4c29-b28f-db73e717165a", + new AccessReviewHistoryDefinitionProperties(), + Context.NONE); + } +} +``` + +### ScopeAccessReviewHistoryDefinitionOperation_DeleteById + +```java +import com.azure.core.util.Context; + +/** Samples for ScopeAccessReviewHistoryDefinitionOperation DeleteById. */ +public final class ScopeAccessReviewHistoryDefinitionOperationDeleteByIdSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/DeleteAccessReviewHistoryDefinition.json + */ + /** + * Sample code: DeleteAccessReview. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void deleteAccessReview( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewHistoryDefinitionOperations() + .deleteByIdWithResponse( + "subscriptions/fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + Context.NONE); + } +} +``` + +### ScopeAccessReviewHistoryDefinitions_GetById + +```java +import com.azure.core.util.Context; + +/** Samples for ScopeAccessReviewHistoryDefinitions GetById. */ +public final class ScopeAccessReviewHistoryDefinitionsGetByIdSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/GetAccessReviewHistoryDefinition.json + */ + /** + * Sample code: GetAccessReviewHistoryDefinition. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReviewHistoryDefinition( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewHistoryDefinitions() + .getByIdWithResponse( + "subscriptions/129a304b-4aea-4b86-a9f7-ba7e2b23737a", + "44724910-d7a5-4c29-b28f-db73e717165a", + Context.NONE); + } +} +``` + +### ScopeAccessReviewHistoryDefinitions_List + +```java +import com.azure.core.util.Context; + +/** Samples for ScopeAccessReviewHistoryDefinitions List. */ +public final class ScopeAccessReviewHistoryDefinitionsListSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/GetAccessReviewHistoryDefinitions.json + */ + /** + * Sample code: GetAccessReviewHistoryDefinitions. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReviewHistoryDefinitions( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewHistoryDefinitions() + .list("subscriptions/129a304b-4aea-4b86-a9f7-ba7e2b23737a", null, Context.NONE); + } +} +``` + +### ScopeAccessReviewInstanceContactedReviewers_List + +```java +import com.azure.core.util.Context; + +/** Samples for ScopeAccessReviewInstanceContactedReviewers List. */ +public final class ScopeAccessReviewInstanceContactedReviewersListSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/GetAccessReviewInstanceContactedReviewers.json + */ + /** + * Sample code: GetAccessReviews. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReviews( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewInstanceContactedReviewers() + .list( + "subscriptions/fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "265785a7-a81f-4201-8a18-bb0db95982b7", + "f25ed880-9c31-4101-bc57-825d8df3b58c", + Context.NONE); + } +} +``` + +### ScopeAccessReviewInstanceDecisions_List + +```java +import com.azure.core.util.Context; + +/** Samples for ScopeAccessReviewInstanceDecisions List. */ +public final class ScopeAccessReviewInstanceDecisionsListSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/GetAccessReviewInstanceDecisions.json + */ + /** + * Sample code: GetAccessReviews. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReviews( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewInstanceDecisions() + .list( + "subscriptions/fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "265785a7-a81f-4201-8a18-bb0db95982b7", + "f25ed880-9c31-4101-bc57-825d8df3b58c", + null, + Context.NONE); + } +} +``` + +### ScopeAccessReviewInstanceOperation_ApplyDecisions + +```java +import com.azure.core.util.Context; + +/** Samples for ScopeAccessReviewInstanceOperation ApplyDecisions. */ +public final class ScopeAccessReviewInstanceOperationApplyDecisionsSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/AccessReviewInstanceApplyDecisions.json + */ + /** + * Sample code: GetAccessReview. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReview(com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewInstanceOperations() + .applyDecisionsWithResponse( + "subscriptions/fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "d9b9e056-7004-470b-bf21-1635e98487da", + Context.NONE); + } +} +``` + +### ScopeAccessReviewInstanceOperation_RecordAllDecisions + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.models.RecordAllDecisionsProperties; + +/** Samples for ScopeAccessReviewInstanceOperation RecordAllDecisions. */ +public final class ScopeAccessReviewInstanceOperationRecordAllDecisionsSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/AccessReviewInstanceRecordAllDecisions.json + */ + /** + * Sample code: AccessReviewInstanceRecordAllDecisions. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void accessReviewInstanceRecordAllDecisions( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewInstanceOperations() + .recordAllDecisionsWithResponse( + "subscriptions/fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "d9b9e056-7004-470b-bf21-1635e98487da", + new RecordAllDecisionsProperties(), + Context.NONE); + } +} +``` + +### ScopeAccessReviewInstanceOperation_ResetDecisions + +```java +import com.azure.core.util.Context; + +/** Samples for ScopeAccessReviewInstanceOperation ResetDecisions. */ +public final class ScopeAccessReviewInstanceOperationResetDecisionsSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/AccessReviewInstanceResetDecisions.json + */ + /** + * Sample code: GetAccessReview. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReview(com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewInstanceOperations() + .resetDecisionsWithResponse( + "subscriptions/fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "d9b9e056-7004-470b-bf21-1635e98487da", + Context.NONE); + } +} +``` + +### ScopeAccessReviewInstanceOperation_SendReminders + +```java +import com.azure.core.util.Context; + +/** Samples for ScopeAccessReviewInstanceOperation SendReminders. */ +public final class ScopeAccessReviewInstanceOperationSendRemindersSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/AccessReviewInstanceSendReminders.json + */ + /** + * Sample code: GetAccessReview. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReview(com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewInstanceOperations() + .sendRemindersWithResponse( + "subscriptions/fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "d9b9e056-7004-470b-bf21-1635e98487da", + Context.NONE); + } +} +``` + +### ScopeAccessReviewInstanceOperation_Stop + +```java +import com.azure.core.util.Context; + +/** Samples for ScopeAccessReviewInstanceOperation Stop. */ +public final class ScopeAccessReviewInstanceOperationStopSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/StopAccessReviewInstance.json + */ + /** + * Sample code: GetAccessReview. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReview(com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewInstanceOperations() + .stopWithResponse( + "subscriptions/fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "d9b9e056-7004-470b-bf21-1635e98487da", + Context.NONE); + } +} +``` + +### ScopeAccessReviewInstances_Create + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewInstanceProperties; + +/** Samples for ScopeAccessReviewInstances Create. */ +public final class ScopeAccessReviewInstancesCreateSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/PutAccessReviewInstance.json + */ + /** + * Sample code: GetAccessReviews. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReviews( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewInstances() + .createWithResponse( + "subscriptions/fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "4135f961-be78-4005-8101-c72a5af307a2", + new AccessReviewInstanceProperties(), + Context.NONE); + } +} +``` + +### ScopeAccessReviewInstances_GetById + +```java +import com.azure.core.util.Context; + +/** Samples for ScopeAccessReviewInstances GetById. */ +public final class ScopeAccessReviewInstancesGetByIdSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/GetAccessReviewInstance.json + */ + /** + * Sample code: GetAccessReviews. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReviews( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewInstances() + .getByIdWithResponse( + "subscriptions/fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "4135f961-be78-4005-8101-c72a5af307a2", + Context.NONE); + } +} +``` + +### ScopeAccessReviewInstances_List + +```java +import com.azure.core.util.Context; + +/** Samples for ScopeAccessReviewInstances List. */ +public final class ScopeAccessReviewInstancesListSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/GetAccessReviewInstances.json + */ + /** + * Sample code: GetAccessReviews. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReviews( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewInstances() + .list( + "subscriptions/fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "265785a7-a81f-4201-8a18-bb0db95982b7", + null, + Context.NONE); + } +} +``` + +### ScopeAccessReviewScheduleDefinitions_CreateOrUpdateById + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewScheduleDefinitionProperties; + +/** Samples for ScopeAccessReviewScheduleDefinitions CreateOrUpdateById. */ +public final class ScopeAccessReviewScheduleDefinitionsCreateOrUpdateByIdSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/PutAccessReviewScheduleDefinition.json + */ + /** + * Sample code: PutAccessReview. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void putAccessReview(com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewScheduleDefinitions() + .createOrUpdateByIdWithResponse( + "subscriptions/fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + new AccessReviewScheduleDefinitionProperties(), + Context.NONE); + } +} +``` + +### ScopeAccessReviewScheduleDefinitions_DeleteById + +```java +import com.azure.core.util.Context; + +/** Samples for ScopeAccessReviewScheduleDefinitions DeleteById. */ +public final class ScopeAccessReviewScheduleDefinitionsDeleteByIdSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/DeleteAccessReviewScheduleDefinition.json + */ + /** + * Sample code: DeleteAccessReview. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void deleteAccessReview( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewScheduleDefinitions() + .deleteByIdWithResponse( + "subscriptions/fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + Context.NONE); + } +} +``` + +### ScopeAccessReviewScheduleDefinitions_GetById + +```java +import com.azure.core.util.Context; + +/** Samples for ScopeAccessReviewScheduleDefinitions GetById. */ +public final class ScopeAccessReviewScheduleDefinitionsGetByIdSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/GetAccessReviewScheduleDefinition.json + */ + /** + * Sample code: GetAccessReview. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReview(com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewScheduleDefinitions() + .getByIdWithResponse( + "subscriptions/fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + Context.NONE); + } +} +``` + +### ScopeAccessReviewScheduleDefinitions_List + +```java +import com.azure.core.util.Context; + +/** Samples for ScopeAccessReviewScheduleDefinitions List. */ +public final class ScopeAccessReviewScheduleDefinitionsListSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/GetAccessReviewScheduleDefinitions.json + */ + /** + * Sample code: GetAccessReviews. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReviews( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewScheduleDefinitions() + .list("subscriptions/fa73e90b-5bf1-45fd-a182-35ce5fc0674d", null, Context.NONE); + } +} +``` + +### ScopeAccessReviewScheduleDefinitions_Stop + +```java +import com.azure.core.util.Context; + +/** Samples for ScopeAccessReviewScheduleDefinitions Stop. */ +public final class ScopeAccessReviewScheduleDefinitionsStopSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/StopAccessReviewScheduleDefinition.json + */ + /** + * Sample code: GetAccessReview. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReview(com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewScheduleDefinitions() + .stopWithResponse( + "subscriptions/fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + Context.NONE); + } +} +``` + +### TenantLevelAccessReviewInstanceContactedReviewers_List + +```java +import com.azure.core.util.Context; + +/** Samples for TenantLevelAccessReviewInstanceContactedReviewers List. */ +public final class TenantLevelAccessReviewInstanceContactedReviewersListSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/TenantLevelGetAccessReviewInstanceContactedReviewers.json + */ + /** + * Sample code: GetAccessReviews. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReviews( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .tenantLevelAccessReviewInstanceContactedReviewers() + .list("265785a7-a81f-4201-8a18-bb0db95982b7", "f25ed880-9c31-4101-bc57-825d8df3b58c", Context.NONE); + } +} +``` + diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/pom.xml b/sdk/authorization/azure-resourcemanager-authorization-generated/pom.xml new file mode 100644 index 0000000000000..fdf8ffa39380a --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/pom.xml @@ -0,0 +1,55 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-authorization-generated + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for Authorization Management + This package contains Microsoft Azure SDK for Authorization Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Access reviews service provides the workflow for running access reviews on different kind of resources. Package tag package-2021-12-01-preview-only. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + + + + com.azure + azure-core + 1.31.0 + + + com.azure + azure-core-management + 1.7.1 + + + diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/AuthorizationManager.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/AuthorizationManager.java new file mode 100644 index 0000000000000..e90ec0b1d1af8 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/AuthorizationManager.java @@ -0,0 +1,710 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.authorization.generated.fluent.AuthorizationManagementClient; +import com.azure.resourcemanager.authorization.generated.implementation.AccessReviewDefaultSettingsOperationsImpl; +import com.azure.resourcemanager.authorization.generated.implementation.AccessReviewHistoryDefinitionInstancesImpl; +import com.azure.resourcemanager.authorization.generated.implementation.AccessReviewHistoryDefinitionInstancesOperationsImpl; +import com.azure.resourcemanager.authorization.generated.implementation.AccessReviewHistoryDefinitionOperationsImpl; +import com.azure.resourcemanager.authorization.generated.implementation.AccessReviewHistoryDefinitionsImpl; +import com.azure.resourcemanager.authorization.generated.implementation.AccessReviewInstanceContactedReviewersImpl; +import com.azure.resourcemanager.authorization.generated.implementation.AccessReviewInstanceDecisionsImpl; +import com.azure.resourcemanager.authorization.generated.implementation.AccessReviewInstanceMyDecisionsImpl; +import com.azure.resourcemanager.authorization.generated.implementation.AccessReviewInstanceOperationsImpl; +import com.azure.resourcemanager.authorization.generated.implementation.AccessReviewInstancesAssignedForMyApprovalsImpl; +import com.azure.resourcemanager.authorization.generated.implementation.AccessReviewInstancesImpl; +import com.azure.resourcemanager.authorization.generated.implementation.AccessReviewScheduleDefinitionsAssignedForMyApprovalsImpl; +import com.azure.resourcemanager.authorization.generated.implementation.AccessReviewScheduleDefinitionsImpl; +import com.azure.resourcemanager.authorization.generated.implementation.AuthorizationManagementClientBuilder; +import com.azure.resourcemanager.authorization.generated.implementation.OperationsImpl; +import com.azure.resourcemanager.authorization.generated.implementation.ScopeAccessReviewDefaultSettingsImpl; +import com.azure.resourcemanager.authorization.generated.implementation.ScopeAccessReviewHistoryDefinitionInstancesImpl; +import com.azure.resourcemanager.authorization.generated.implementation.ScopeAccessReviewHistoryDefinitionInstancesOperationsImpl; +import com.azure.resourcemanager.authorization.generated.implementation.ScopeAccessReviewHistoryDefinitionOperationsImpl; +import com.azure.resourcemanager.authorization.generated.implementation.ScopeAccessReviewHistoryDefinitionsImpl; +import com.azure.resourcemanager.authorization.generated.implementation.ScopeAccessReviewInstanceContactedReviewersImpl; +import com.azure.resourcemanager.authorization.generated.implementation.ScopeAccessReviewInstanceDecisionsImpl; +import com.azure.resourcemanager.authorization.generated.implementation.ScopeAccessReviewInstanceOperationsImpl; +import com.azure.resourcemanager.authorization.generated.implementation.ScopeAccessReviewInstancesImpl; +import com.azure.resourcemanager.authorization.generated.implementation.ScopeAccessReviewScheduleDefinitionsImpl; +import com.azure.resourcemanager.authorization.generated.implementation.TenantLevelAccessReviewInstanceContactedReviewersImpl; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewDefaultSettingsOperations; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewHistoryDefinitionInstances; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewHistoryDefinitionInstancesOperations; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewHistoryDefinitionOperations; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewHistoryDefinitions; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewInstanceContactedReviewers; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewInstanceDecisions; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewInstanceMyDecisions; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewInstanceOperations; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewInstances; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewInstancesAssignedForMyApprovals; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewScheduleDefinitions; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewScheduleDefinitionsAssignedForMyApprovals; +import com.azure.resourcemanager.authorization.generated.models.Operations; +import com.azure.resourcemanager.authorization.generated.models.ScopeAccessReviewDefaultSettings; +import com.azure.resourcemanager.authorization.generated.models.ScopeAccessReviewHistoryDefinitionInstances; +import com.azure.resourcemanager.authorization.generated.models.ScopeAccessReviewHistoryDefinitionInstancesOperations; +import com.azure.resourcemanager.authorization.generated.models.ScopeAccessReviewHistoryDefinitionOperations; +import com.azure.resourcemanager.authorization.generated.models.ScopeAccessReviewHistoryDefinitions; +import com.azure.resourcemanager.authorization.generated.models.ScopeAccessReviewInstanceContactedReviewers; +import com.azure.resourcemanager.authorization.generated.models.ScopeAccessReviewInstanceDecisions; +import com.azure.resourcemanager.authorization.generated.models.ScopeAccessReviewInstanceOperations; +import com.azure.resourcemanager.authorization.generated.models.ScopeAccessReviewInstances; +import com.azure.resourcemanager.authorization.generated.models.ScopeAccessReviewScheduleDefinitions; +import com.azure.resourcemanager.authorization.generated.models.TenantLevelAccessReviewInstanceContactedReviewers; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * Entry point to AuthorizationManager. Access reviews service provides the workflow for running access reviews on + * different kind of resources. + */ +public final class AuthorizationManager { + private Operations operations; + + private AccessReviewHistoryDefinitions accessReviewHistoryDefinitions; + + private AccessReviewHistoryDefinitionOperations accessReviewHistoryDefinitionOperations; + + private AccessReviewHistoryDefinitionInstances accessReviewHistoryDefinitionInstances; + + private AccessReviewHistoryDefinitionInstancesOperations accessReviewHistoryDefinitionInstancesOperations; + + private AccessReviewScheduleDefinitions accessReviewScheduleDefinitions; + + private AccessReviewInstances accessReviewInstances; + + private AccessReviewInstanceOperations accessReviewInstanceOperations; + + private AccessReviewInstanceDecisions accessReviewInstanceDecisions; + + private AccessReviewInstanceContactedReviewers accessReviewInstanceContactedReviewers; + + private AccessReviewDefaultSettingsOperations accessReviewDefaultSettingsOperations; + + private ScopeAccessReviewHistoryDefinitions scopeAccessReviewHistoryDefinitions; + + private ScopeAccessReviewHistoryDefinitionOperations scopeAccessReviewHistoryDefinitionOperations; + + private ScopeAccessReviewHistoryDefinitionInstances scopeAccessReviewHistoryDefinitionInstances; + + private ScopeAccessReviewHistoryDefinitionInstancesOperations scopeAccessReviewHistoryDefinitionInstancesOperations; + + private ScopeAccessReviewScheduleDefinitions scopeAccessReviewScheduleDefinitions; + + private ScopeAccessReviewInstances scopeAccessReviewInstances; + + private ScopeAccessReviewInstanceOperations scopeAccessReviewInstanceOperations; + + private ScopeAccessReviewInstanceDecisions scopeAccessReviewInstanceDecisions; + + private ScopeAccessReviewInstanceContactedReviewers scopeAccessReviewInstanceContactedReviewers; + + private ScopeAccessReviewDefaultSettings scopeAccessReviewDefaultSettings; + + private AccessReviewScheduleDefinitionsAssignedForMyApprovals accessReviewScheduleDefinitionsAssignedForMyApprovals; + + private AccessReviewInstancesAssignedForMyApprovals accessReviewInstancesAssignedForMyApprovals; + + private AccessReviewInstanceMyDecisions accessReviewInstanceMyDecisions; + + private TenantLevelAccessReviewInstanceContactedReviewers tenantLevelAccessReviewInstanceContactedReviewers; + + private final AuthorizationManagementClient clientObject; + + private AuthorizationManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new AuthorizationManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of Authorization service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Authorization service API instance. + */ + public static AuthorizationManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Creates an instance of Authorization service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the Authorization service API instance. + */ + public static AuthorizationManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new AuthorizationManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create AuthorizationManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new AuthorizationManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private RetryOptions retryOptions; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the retry options for the HTTP pipeline retry policy. + * + *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = + Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of Authorization service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Authorization service API instance. + */ + public AuthorizationManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.authorization.generated") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new AuthorizationManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of AccessReviewHistoryDefinitions. + * + * @return Resource collection API of AccessReviewHistoryDefinitions. + */ + public AccessReviewHistoryDefinitions accessReviewHistoryDefinitions() { + if (this.accessReviewHistoryDefinitions == null) { + this.accessReviewHistoryDefinitions = + new AccessReviewHistoryDefinitionsImpl(clientObject.getAccessReviewHistoryDefinitions(), this); + } + return accessReviewHistoryDefinitions; + } + + /** + * Gets the resource collection API of AccessReviewHistoryDefinitionOperations. It manages + * AccessReviewHistoryDefinition. + * + * @return Resource collection API of AccessReviewHistoryDefinitionOperations. + */ + public AccessReviewHistoryDefinitionOperations accessReviewHistoryDefinitionOperations() { + if (this.accessReviewHistoryDefinitionOperations == null) { + this.accessReviewHistoryDefinitionOperations = + new AccessReviewHistoryDefinitionOperationsImpl( + clientObject.getAccessReviewHistoryDefinitionOperations(), this); + } + return accessReviewHistoryDefinitionOperations; + } + + /** + * Gets the resource collection API of AccessReviewHistoryDefinitionInstances. + * + * @return Resource collection API of AccessReviewHistoryDefinitionInstances. + */ + public AccessReviewHistoryDefinitionInstances accessReviewHistoryDefinitionInstances() { + if (this.accessReviewHistoryDefinitionInstances == null) { + this.accessReviewHistoryDefinitionInstances = + new AccessReviewHistoryDefinitionInstancesImpl( + clientObject.getAccessReviewHistoryDefinitionInstances(), this); + } + return accessReviewHistoryDefinitionInstances; + } + + /** + * Gets the resource collection API of AccessReviewHistoryDefinitionInstancesOperations. + * + * @return Resource collection API of AccessReviewHistoryDefinitionInstancesOperations. + */ + public AccessReviewHistoryDefinitionInstancesOperations accessReviewHistoryDefinitionInstancesOperations() { + if (this.accessReviewHistoryDefinitionInstancesOperations == null) { + this.accessReviewHistoryDefinitionInstancesOperations = + new AccessReviewHistoryDefinitionInstancesOperationsImpl( + clientObject.getAccessReviewHistoryDefinitionInstancesOperations(), this); + } + return accessReviewHistoryDefinitionInstancesOperations; + } + + /** + * Gets the resource collection API of AccessReviewScheduleDefinitions. It manages AccessReviewScheduleDefinition. + * + * @return Resource collection API of AccessReviewScheduleDefinitions. + */ + public AccessReviewScheduleDefinitions accessReviewScheduleDefinitions() { + if (this.accessReviewScheduleDefinitions == null) { + this.accessReviewScheduleDefinitions = + new AccessReviewScheduleDefinitionsImpl(clientObject.getAccessReviewScheduleDefinitions(), this); + } + return accessReviewScheduleDefinitions; + } + + /** + * Gets the resource collection API of AccessReviewInstances. It manages AccessReviewInstance. + * + * @return Resource collection API of AccessReviewInstances. + */ + public AccessReviewInstances accessReviewInstances() { + if (this.accessReviewInstances == null) { + this.accessReviewInstances = new AccessReviewInstancesImpl(clientObject.getAccessReviewInstances(), this); + } + return accessReviewInstances; + } + + /** + * Gets the resource collection API of AccessReviewInstanceOperations. + * + * @return Resource collection API of AccessReviewInstanceOperations. + */ + public AccessReviewInstanceOperations accessReviewInstanceOperations() { + if (this.accessReviewInstanceOperations == null) { + this.accessReviewInstanceOperations = + new AccessReviewInstanceOperationsImpl(clientObject.getAccessReviewInstanceOperations(), this); + } + return accessReviewInstanceOperations; + } + + /** + * Gets the resource collection API of AccessReviewInstanceDecisions. + * + * @return Resource collection API of AccessReviewInstanceDecisions. + */ + public AccessReviewInstanceDecisions accessReviewInstanceDecisions() { + if (this.accessReviewInstanceDecisions == null) { + this.accessReviewInstanceDecisions = + new AccessReviewInstanceDecisionsImpl(clientObject.getAccessReviewInstanceDecisions(), this); + } + return accessReviewInstanceDecisions; + } + + /** + * Gets the resource collection API of AccessReviewInstanceContactedReviewers. + * + * @return Resource collection API of AccessReviewInstanceContactedReviewers. + */ + public AccessReviewInstanceContactedReviewers accessReviewInstanceContactedReviewers() { + if (this.accessReviewInstanceContactedReviewers == null) { + this.accessReviewInstanceContactedReviewers = + new AccessReviewInstanceContactedReviewersImpl( + clientObject.getAccessReviewInstanceContactedReviewers(), this); + } + return accessReviewInstanceContactedReviewers; + } + + /** + * Gets the resource collection API of AccessReviewDefaultSettingsOperations. + * + * @return Resource collection API of AccessReviewDefaultSettingsOperations. + */ + public AccessReviewDefaultSettingsOperations accessReviewDefaultSettingsOperations() { + if (this.accessReviewDefaultSettingsOperations == null) { + this.accessReviewDefaultSettingsOperations = + new AccessReviewDefaultSettingsOperationsImpl( + clientObject.getAccessReviewDefaultSettingsOperations(), this); + } + return accessReviewDefaultSettingsOperations; + } + + /** + * Gets the resource collection API of ScopeAccessReviewHistoryDefinitions. + * + * @return Resource collection API of ScopeAccessReviewHistoryDefinitions. + */ + public ScopeAccessReviewHistoryDefinitions scopeAccessReviewHistoryDefinitions() { + if (this.scopeAccessReviewHistoryDefinitions == null) { + this.scopeAccessReviewHistoryDefinitions = + new ScopeAccessReviewHistoryDefinitionsImpl( + clientObject.getScopeAccessReviewHistoryDefinitions(), this); + } + return scopeAccessReviewHistoryDefinitions; + } + + /** + * Gets the resource collection API of ScopeAccessReviewHistoryDefinitionOperations. + * + * @return Resource collection API of ScopeAccessReviewHistoryDefinitionOperations. + */ + public ScopeAccessReviewHistoryDefinitionOperations scopeAccessReviewHistoryDefinitionOperations() { + if (this.scopeAccessReviewHistoryDefinitionOperations == null) { + this.scopeAccessReviewHistoryDefinitionOperations = + new ScopeAccessReviewHistoryDefinitionOperationsImpl( + clientObject.getScopeAccessReviewHistoryDefinitionOperations(), this); + } + return scopeAccessReviewHistoryDefinitionOperations; + } + + /** + * Gets the resource collection API of ScopeAccessReviewHistoryDefinitionInstances. + * + * @return Resource collection API of ScopeAccessReviewHistoryDefinitionInstances. + */ + public ScopeAccessReviewHistoryDefinitionInstances scopeAccessReviewHistoryDefinitionInstances() { + if (this.scopeAccessReviewHistoryDefinitionInstances == null) { + this.scopeAccessReviewHistoryDefinitionInstances = + new ScopeAccessReviewHistoryDefinitionInstancesImpl( + clientObject.getScopeAccessReviewHistoryDefinitionInstances(), this); + } + return scopeAccessReviewHistoryDefinitionInstances; + } + + /** + * Gets the resource collection API of ScopeAccessReviewHistoryDefinitionInstancesOperations. + * + * @return Resource collection API of ScopeAccessReviewHistoryDefinitionInstancesOperations. + */ + public ScopeAccessReviewHistoryDefinitionInstancesOperations + scopeAccessReviewHistoryDefinitionInstancesOperations() { + if (this.scopeAccessReviewHistoryDefinitionInstancesOperations == null) { + this.scopeAccessReviewHistoryDefinitionInstancesOperations = + new ScopeAccessReviewHistoryDefinitionInstancesOperationsImpl( + clientObject.getScopeAccessReviewHistoryDefinitionInstancesOperations(), this); + } + return scopeAccessReviewHistoryDefinitionInstancesOperations; + } + + /** + * Gets the resource collection API of ScopeAccessReviewScheduleDefinitions. + * + * @return Resource collection API of ScopeAccessReviewScheduleDefinitions. + */ + public ScopeAccessReviewScheduleDefinitions scopeAccessReviewScheduleDefinitions() { + if (this.scopeAccessReviewScheduleDefinitions == null) { + this.scopeAccessReviewScheduleDefinitions = + new ScopeAccessReviewScheduleDefinitionsImpl( + clientObject.getScopeAccessReviewScheduleDefinitions(), this); + } + return scopeAccessReviewScheduleDefinitions; + } + + /** + * Gets the resource collection API of ScopeAccessReviewInstances. + * + * @return Resource collection API of ScopeAccessReviewInstances. + */ + public ScopeAccessReviewInstances scopeAccessReviewInstances() { + if (this.scopeAccessReviewInstances == null) { + this.scopeAccessReviewInstances = + new ScopeAccessReviewInstancesImpl(clientObject.getScopeAccessReviewInstances(), this); + } + return scopeAccessReviewInstances; + } + + /** + * Gets the resource collection API of ScopeAccessReviewInstanceOperations. + * + * @return Resource collection API of ScopeAccessReviewInstanceOperations. + */ + public ScopeAccessReviewInstanceOperations scopeAccessReviewInstanceOperations() { + if (this.scopeAccessReviewInstanceOperations == null) { + this.scopeAccessReviewInstanceOperations = + new ScopeAccessReviewInstanceOperationsImpl( + clientObject.getScopeAccessReviewInstanceOperations(), this); + } + return scopeAccessReviewInstanceOperations; + } + + /** + * Gets the resource collection API of ScopeAccessReviewInstanceDecisions. + * + * @return Resource collection API of ScopeAccessReviewInstanceDecisions. + */ + public ScopeAccessReviewInstanceDecisions scopeAccessReviewInstanceDecisions() { + if (this.scopeAccessReviewInstanceDecisions == null) { + this.scopeAccessReviewInstanceDecisions = + new ScopeAccessReviewInstanceDecisionsImpl(clientObject.getScopeAccessReviewInstanceDecisions(), this); + } + return scopeAccessReviewInstanceDecisions; + } + + /** + * Gets the resource collection API of ScopeAccessReviewInstanceContactedReviewers. + * + * @return Resource collection API of ScopeAccessReviewInstanceContactedReviewers. + */ + public ScopeAccessReviewInstanceContactedReviewers scopeAccessReviewInstanceContactedReviewers() { + if (this.scopeAccessReviewInstanceContactedReviewers == null) { + this.scopeAccessReviewInstanceContactedReviewers = + new ScopeAccessReviewInstanceContactedReviewersImpl( + clientObject.getScopeAccessReviewInstanceContactedReviewers(), this); + } + return scopeAccessReviewInstanceContactedReviewers; + } + + /** + * Gets the resource collection API of ScopeAccessReviewDefaultSettings. + * + * @return Resource collection API of ScopeAccessReviewDefaultSettings. + */ + public ScopeAccessReviewDefaultSettings scopeAccessReviewDefaultSettings() { + if (this.scopeAccessReviewDefaultSettings == null) { + this.scopeAccessReviewDefaultSettings = + new ScopeAccessReviewDefaultSettingsImpl(clientObject.getScopeAccessReviewDefaultSettings(), this); + } + return scopeAccessReviewDefaultSettings; + } + + /** + * Gets the resource collection API of AccessReviewScheduleDefinitionsAssignedForMyApprovals. + * + * @return Resource collection API of AccessReviewScheduleDefinitionsAssignedForMyApprovals. + */ + public AccessReviewScheduleDefinitionsAssignedForMyApprovals + accessReviewScheduleDefinitionsAssignedForMyApprovals() { + if (this.accessReviewScheduleDefinitionsAssignedForMyApprovals == null) { + this.accessReviewScheduleDefinitionsAssignedForMyApprovals = + new AccessReviewScheduleDefinitionsAssignedForMyApprovalsImpl( + clientObject.getAccessReviewScheduleDefinitionsAssignedForMyApprovals(), this); + } + return accessReviewScheduleDefinitionsAssignedForMyApprovals; + } + + /** + * Gets the resource collection API of AccessReviewInstancesAssignedForMyApprovals. + * + * @return Resource collection API of AccessReviewInstancesAssignedForMyApprovals. + */ + public AccessReviewInstancesAssignedForMyApprovals accessReviewInstancesAssignedForMyApprovals() { + if (this.accessReviewInstancesAssignedForMyApprovals == null) { + this.accessReviewInstancesAssignedForMyApprovals = + new AccessReviewInstancesAssignedForMyApprovalsImpl( + clientObject.getAccessReviewInstancesAssignedForMyApprovals(), this); + } + return accessReviewInstancesAssignedForMyApprovals; + } + + /** + * Gets the resource collection API of AccessReviewInstanceMyDecisions. + * + * @return Resource collection API of AccessReviewInstanceMyDecisions. + */ + public AccessReviewInstanceMyDecisions accessReviewInstanceMyDecisions() { + if (this.accessReviewInstanceMyDecisions == null) { + this.accessReviewInstanceMyDecisions = + new AccessReviewInstanceMyDecisionsImpl(clientObject.getAccessReviewInstanceMyDecisions(), this); + } + return accessReviewInstanceMyDecisions; + } + + /** + * Gets the resource collection API of TenantLevelAccessReviewInstanceContactedReviewers. + * + * @return Resource collection API of TenantLevelAccessReviewInstanceContactedReviewers. + */ + public TenantLevelAccessReviewInstanceContactedReviewers tenantLevelAccessReviewInstanceContactedReviewers() { + if (this.tenantLevelAccessReviewInstanceContactedReviewers == null) { + this.tenantLevelAccessReviewInstanceContactedReviewers = + new TenantLevelAccessReviewInstanceContactedReviewersImpl( + clientObject.getTenantLevelAccessReviewInstanceContactedReviewers(), this); + } + return tenantLevelAccessReviewInstanceContactedReviewers; + } + + /** + * @return Wrapped service client AuthorizationManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + */ + public AuthorizationManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewDefaultSettingsOperationsClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewDefaultSettingsOperationsClient.java new file mode 100644 index 0000000000000..38d659404aac5 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewDefaultSettingsOperationsClient.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewDefaultSettingsInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewScheduleSettings; + +/** + * An instance of this class provides access to all the operations defined in + * AccessReviewDefaultSettingsOperationsClient. + */ +public interface AccessReviewDefaultSettingsOperationsClient { + /** + * Get access review default settings for the subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review default settings for the subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessReviewDefaultSettingsInner get(); + + /** + * Get access review default settings for the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review default settings for the subscription along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(Context context); + + /** + * Get access review default settings for the subscription. + * + * @param properties Access review schedule settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review default settings for the subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessReviewDefaultSettingsInner put(AccessReviewScheduleSettings properties); + + /** + * Get access review default settings for the subscription. + * + * @param properties Access review schedule settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review default settings for the subscription along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response putWithResponse( + AccessReviewScheduleSettings properties, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewHistoryDefinitionInstancesClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewHistoryDefinitionInstancesClient.java new file mode 100644 index 0000000000000..bc7ecc6e83027 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewHistoryDefinitionInstancesClient.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryInstanceInner; + +/** + * An instance of this class provides access to all the operations defined in + * AccessReviewHistoryDefinitionInstancesClient. + */ +public interface AccessReviewHistoryDefinitionInstancesClient { + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review History Definition Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessReviewHistoryInstanceInner generateDownloadUri(String historyDefinitionId, String instanceId); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review History Definition Instance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response generateDownloadUriWithResponse( + String historyDefinitionId, String instanceId, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewHistoryDefinitionInstancesOperationsClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewHistoryDefinitionInstancesOperationsClient.java new file mode 100644 index 0000000000000..1b38c8a319466 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewHistoryDefinitionInstancesOperationsClient.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryInstanceInner; + +/** + * An instance of this class provides access to all the operations defined in + * AccessReviewHistoryDefinitionInstancesOperationsClient. + */ +public interface AccessReviewHistoryDefinitionInstancesOperationsClient { + /** + * Get access review history definition instances by definition Id. + * + * @param historyDefinitionId The id of the access review history definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review history definition instances by definition Id as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String historyDefinitionId); + + /** + * Get access review history definition instances by definition Id. + * + * @param historyDefinitionId The id of the access review history definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review history definition instances by definition Id as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String historyDefinitionId, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewHistoryDefinitionOperationsClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewHistoryDefinitionOperationsClient.java new file mode 100644 index 0000000000000..ae1768fedebf7 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewHistoryDefinitionOperationsClient.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryDefinitionInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryDefinitionProperties; + +/** + * An instance of this class provides access to all the operations defined in + * AccessReviewHistoryDefinitionOperationsClient. + */ +public interface AccessReviewHistoryDefinitionOperationsClient { + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review History Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessReviewHistoryDefinitionInner create( + String historyDefinitionId, AccessReviewHistoryDefinitionProperties properties); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review History Definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String historyDefinitionId, AccessReviewHistoryDefinitionProperties properties, Context context); + + /** + * Delete an access review history definition. + * + * @param historyDefinitionId The id of the access review history definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteById(String historyDefinitionId); + + /** + * Delete an access review history definition. + * + * @param historyDefinitionId The id of the access review history definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteByIdWithResponse(String historyDefinitionId, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewHistoryDefinitionsClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewHistoryDefinitionsClient.java new file mode 100644 index 0000000000000..7680d62734df2 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewHistoryDefinitionsClient.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryDefinitionInner; + +/** An instance of this class provides access to all the operations defined in AccessReviewHistoryDefinitionsClient. */ +public interface AccessReviewHistoryDefinitionsClient { + /** + * Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available + * for 30 days after creation. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review History Definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available + * for 30 days after creation. + * + * @param filter The filter to apply on the operation. Only standard filters on definition name and created date are + * supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review History Definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String filter, Context context); + + /** + * Get access review history definition by definition Id. + * + * @param historyDefinitionId The id of the access review history definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review history definition by definition Id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessReviewHistoryDefinitionInner getById(String historyDefinitionId); + + /** + * Get access review history definition by definition Id. + * + * @param historyDefinitionId The id of the access review history definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review history definition by definition Id along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByIdWithResponse(String historyDefinitionId, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewInstanceContactedReviewersClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewInstanceContactedReviewersClient.java new file mode 100644 index 0000000000000..bff9ff6a7e3c1 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewInstanceContactedReviewersClient.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewContactedReviewerInner; + +/** + * An instance of this class provides access to all the operations defined in + * AccessReviewInstanceContactedReviewersClient. + */ +public interface AccessReviewInstanceContactedReviewersClient { + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance contacted reviewers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String scheduleDefinitionId, String id); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance contacted reviewers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String scheduleDefinitionId, String id, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewInstanceDecisionsClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewInstanceDecisionsClient.java new file mode 100644 index 0000000000000..d1023194da9b4 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewInstanceDecisionsClient.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewDecisionInner; + +/** An instance of this class provides access to all the operations defined in AccessReviewInstanceDecisionsClient. */ +public interface AccessReviewInstanceDecisionsClient { + /** + * Get access review instance decisions. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance decisions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String scheduleDefinitionId, String id); + + /** + * 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 filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance decisions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String scheduleDefinitionId, String id, String filter, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewInstanceMyDecisionsClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewInstanceMyDecisionsClient.java new file mode 100644 index 0000000000000..ac3b57134c839 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewInstanceMyDecisionsClient.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewDecisionInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewDecisionProperties; + +/** An instance of this class provides access to all the operations defined in AccessReviewInstanceMyDecisionsClient. */ +public interface AccessReviewInstanceMyDecisionsClient { + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return my access review instance decisions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String scheduleDefinitionId, String id); + + /** + * 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 filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return my access review instance decisions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String scheduleDefinitionId, String id, String filter, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return my single access review instance decision. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessReviewDecisionInner getById(String scheduleDefinitionId, String id, String decisionId); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return my single access review instance decision along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByIdWithResponse( + String scheduleDefinitionId, String id, String decisionId, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessReviewDecisionInner patch( + String scheduleDefinitionId, String id, String decisionId, AccessReviewDecisionProperties properties); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response patchWithResponse( + String scheduleDefinitionId, + String id, + String decisionId, + AccessReviewDecisionProperties properties, + Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewInstanceOperationsClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewInstanceOperationsClient.java new file mode 100644 index 0000000000000..13c539519c073 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewInstanceOperationsClient.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** An instance of this class provides access to all the operations defined in AccessReviewInstanceOperationsClient. */ +public interface AccessReviewInstanceOperationsClient { + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void stop(String scheduleDefinitionId, String id); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response stopWithResponse(String scheduleDefinitionId, String id, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void resetDecisions(String scheduleDefinitionId, String id); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response resetDecisionsWithResponse(String scheduleDefinitionId, String id, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void applyDecisions(String scheduleDefinitionId, String id); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response applyDecisionsWithResponse(String scheduleDefinitionId, String id, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void sendReminders(String scheduleDefinitionId, String id); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response sendRemindersWithResponse(String scheduleDefinitionId, String id, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void acceptRecommendations(String scheduleDefinitionId, String id); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response acceptRecommendationsWithResponse(String scheduleDefinitionId, String id, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewInstancesAssignedForMyApprovalsClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewInstancesAssignedForMyApprovalsClient.java new file mode 100644 index 0000000000000..04b0e71eca7b9 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewInstancesAssignedForMyApprovalsClient.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewInstanceInner; + +/** + * An instance of this class provides access to all the operations defined in + * AccessReviewInstancesAssignedForMyApprovalsClient. + */ +public interface AccessReviewInstancesAssignedForMyApprovalsClient { + /** + * Get access review instances assigned for my approval. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances assigned for my approval as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String scheduleDefinitionId); + + /** + * Get access review instances assigned for my approval. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances assigned for my approval as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String scheduleDefinitionId, String filter, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single access review instance assigned for my approval. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessReviewInstanceInner getById(String scheduleDefinitionId, String id); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single access review instance assigned for my approval along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByIdWithResponse(String scheduleDefinitionId, String id, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewInstancesClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewInstancesClient.java new file mode 100644 index 0000000000000..7fff69d01378f --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewInstancesClient.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewInstanceInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewInstanceProperties; + +/** An instance of this class provides access to all the operations defined in AccessReviewInstancesClient. */ +public interface AccessReviewInstancesClient { + /** + * Get access review instances. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String scheduleDefinitionId); + + /** + * Get access review instances. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String scheduleDefinitionId, String filter, Context context); + + /** + * Get access review instances. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessReviewInstanceInner getById(String scheduleDefinitionId, String id); + + /** + * Get access review instances. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByIdWithResponse(String scheduleDefinitionId, String id, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessReviewInstanceInner create(String scheduleDefinitionId, String id, AccessReviewInstanceProperties properties); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review Instance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String scheduleDefinitionId, String id, AccessReviewInstanceProperties properties, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewScheduleDefinitionsAssignedForMyApprovalsClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewScheduleDefinitionsAssignedForMyApprovalsClient.java new file mode 100644 index 0000000000000..5accea524040a --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewScheduleDefinitionsAssignedForMyApprovalsClient.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewScheduleDefinitionInner; + +/** + * An instance of this class provides access to all the operations defined in + * AccessReviewScheduleDefinitionsAssignedForMyApprovalsClient. + */ +public interface AccessReviewScheduleDefinitionsAssignedForMyApprovalsClient { + /** + * Get access review instances assigned for my approval. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances assigned for my approval as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Get access review instances assigned for my approval. + * + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances assigned for my approval as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String filter, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewScheduleDefinitionsClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewScheduleDefinitionsClient.java new file mode 100644 index 0000000000000..3caec01706baf --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AccessReviewScheduleDefinitionsClient.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewScheduleDefinitionInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewScheduleDefinitionProperties; + +/** An instance of this class provides access to all the operations defined in AccessReviewScheduleDefinitionsClient. */ +public interface AccessReviewScheduleDefinitionsClient { + /** + * Get access review schedule definitions. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review schedule definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Get access review schedule definitions. + * + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review schedule definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String filter, Context context); + + /** + * Get single access review definition. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single access review definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessReviewScheduleDefinitionInner getById(String scheduleDefinitionId); + + /** + * Get single access review definition. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single access review definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByIdWithResponse(String scheduleDefinitionId, Context context); + + /** + * Delete access review schedule definition. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteById(String scheduleDefinitionId); + + /** + * Delete access review schedule definition. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteByIdWithResponse(String scheduleDefinitionId, Context context); + + /** + * Create or Update access review schedule definition. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param properties Access review schedule definition properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review Schedule Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessReviewScheduleDefinitionInner createOrUpdateById( + String scheduleDefinitionId, AccessReviewScheduleDefinitionProperties properties); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review Schedule Definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateByIdWithResponse( + String scheduleDefinitionId, AccessReviewScheduleDefinitionProperties properties, Context context); + + /** + * Stop access review definition. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void stop(String scheduleDefinitionId); + + /** + * Stop access review definition. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response stopWithResponse(String scheduleDefinitionId, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AuthorizationManagementClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AuthorizationManagementClient.java new file mode 100644 index 0000000000000..e266b2a901f67 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AuthorizationManagementClient.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for AuthorizationManagementClient class. */ +public interface AuthorizationManagementClient { + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the AccessReviewHistoryDefinitionsClient object to access its operations. + * + * @return the AccessReviewHistoryDefinitionsClient object. + */ + AccessReviewHistoryDefinitionsClient getAccessReviewHistoryDefinitions(); + + /** + * Gets the AccessReviewHistoryDefinitionOperationsClient object to access its operations. + * + * @return the AccessReviewHistoryDefinitionOperationsClient object. + */ + AccessReviewHistoryDefinitionOperationsClient getAccessReviewHistoryDefinitionOperations(); + + /** + * Gets the AccessReviewHistoryDefinitionInstancesClient object to access its operations. + * + * @return the AccessReviewHistoryDefinitionInstancesClient object. + */ + AccessReviewHistoryDefinitionInstancesClient getAccessReviewHistoryDefinitionInstances(); + + /** + * Gets the AccessReviewHistoryDefinitionInstancesOperationsClient object to access its operations. + * + * @return the AccessReviewHistoryDefinitionInstancesOperationsClient object. + */ + AccessReviewHistoryDefinitionInstancesOperationsClient getAccessReviewHistoryDefinitionInstancesOperations(); + + /** + * Gets the AccessReviewScheduleDefinitionsClient object to access its operations. + * + * @return the AccessReviewScheduleDefinitionsClient object. + */ + AccessReviewScheduleDefinitionsClient getAccessReviewScheduleDefinitions(); + + /** + * Gets the AccessReviewInstancesClient object to access its operations. + * + * @return the AccessReviewInstancesClient object. + */ + AccessReviewInstancesClient getAccessReviewInstances(); + + /** + * Gets the AccessReviewInstanceOperationsClient object to access its operations. + * + * @return the AccessReviewInstanceOperationsClient object. + */ + AccessReviewInstanceOperationsClient getAccessReviewInstanceOperations(); + + /** + * Gets the AccessReviewInstanceDecisionsClient object to access its operations. + * + * @return the AccessReviewInstanceDecisionsClient object. + */ + AccessReviewInstanceDecisionsClient getAccessReviewInstanceDecisions(); + + /** + * Gets the AccessReviewInstanceContactedReviewersClient object to access its operations. + * + * @return the AccessReviewInstanceContactedReviewersClient object. + */ + AccessReviewInstanceContactedReviewersClient getAccessReviewInstanceContactedReviewers(); + + /** + * Gets the AccessReviewDefaultSettingsOperationsClient object to access its operations. + * + * @return the AccessReviewDefaultSettingsOperationsClient object. + */ + AccessReviewDefaultSettingsOperationsClient getAccessReviewDefaultSettingsOperations(); + + /** + * Gets the ScopeAccessReviewHistoryDefinitionsClient object to access its operations. + * + * @return the ScopeAccessReviewHistoryDefinitionsClient object. + */ + ScopeAccessReviewHistoryDefinitionsClient getScopeAccessReviewHistoryDefinitions(); + + /** + * Gets the ScopeAccessReviewHistoryDefinitionOperationsClient object to access its operations. + * + * @return the ScopeAccessReviewHistoryDefinitionOperationsClient object. + */ + ScopeAccessReviewHistoryDefinitionOperationsClient getScopeAccessReviewHistoryDefinitionOperations(); + + /** + * Gets the ScopeAccessReviewHistoryDefinitionInstancesClient object to access its operations. + * + * @return the ScopeAccessReviewHistoryDefinitionInstancesClient object. + */ + ScopeAccessReviewHistoryDefinitionInstancesClient getScopeAccessReviewHistoryDefinitionInstances(); + + /** + * Gets the ScopeAccessReviewHistoryDefinitionInstancesOperationsClient object to access its operations. + * + * @return the ScopeAccessReviewHistoryDefinitionInstancesOperationsClient object. + */ + ScopeAccessReviewHistoryDefinitionInstancesOperationsClient + getScopeAccessReviewHistoryDefinitionInstancesOperations(); + + /** + * Gets the ScopeAccessReviewScheduleDefinitionsClient object to access its operations. + * + * @return the ScopeAccessReviewScheduleDefinitionsClient object. + */ + ScopeAccessReviewScheduleDefinitionsClient getScopeAccessReviewScheduleDefinitions(); + + /** + * Gets the ScopeAccessReviewInstancesClient object to access its operations. + * + * @return the ScopeAccessReviewInstancesClient object. + */ + ScopeAccessReviewInstancesClient getScopeAccessReviewInstances(); + + /** + * Gets the ScopeAccessReviewInstanceOperationsClient object to access its operations. + * + * @return the ScopeAccessReviewInstanceOperationsClient object. + */ + ScopeAccessReviewInstanceOperationsClient getScopeAccessReviewInstanceOperations(); + + /** + * Gets the ScopeAccessReviewInstanceDecisionsClient object to access its operations. + * + * @return the ScopeAccessReviewInstanceDecisionsClient object. + */ + ScopeAccessReviewInstanceDecisionsClient getScopeAccessReviewInstanceDecisions(); + + /** + * Gets the ScopeAccessReviewInstanceContactedReviewersClient object to access its operations. + * + * @return the ScopeAccessReviewInstanceContactedReviewersClient object. + */ + ScopeAccessReviewInstanceContactedReviewersClient getScopeAccessReviewInstanceContactedReviewers(); + + /** + * Gets the ScopeAccessReviewDefaultSettingsClient object to access its operations. + * + * @return the ScopeAccessReviewDefaultSettingsClient object. + */ + ScopeAccessReviewDefaultSettingsClient getScopeAccessReviewDefaultSettings(); + + /** + * Gets the AccessReviewScheduleDefinitionsAssignedForMyApprovalsClient object to access its operations. + * + * @return the AccessReviewScheduleDefinitionsAssignedForMyApprovalsClient object. + */ + AccessReviewScheduleDefinitionsAssignedForMyApprovalsClient + getAccessReviewScheduleDefinitionsAssignedForMyApprovals(); + + /** + * Gets the AccessReviewInstancesAssignedForMyApprovalsClient object to access its operations. + * + * @return the AccessReviewInstancesAssignedForMyApprovalsClient object. + */ + AccessReviewInstancesAssignedForMyApprovalsClient getAccessReviewInstancesAssignedForMyApprovals(); + + /** + * Gets the AccessReviewInstanceMyDecisionsClient object to access its operations. + * + * @return the AccessReviewInstanceMyDecisionsClient object. + */ + AccessReviewInstanceMyDecisionsClient getAccessReviewInstanceMyDecisions(); + + /** + * Gets the TenantLevelAccessReviewInstanceContactedReviewersClient object to access its operations. + * + * @return the TenantLevelAccessReviewInstanceContactedReviewersClient object. + */ + TenantLevelAccessReviewInstanceContactedReviewersClient getTenantLevelAccessReviewInstanceContactedReviewers(); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/OperationsClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/OperationsClient.java new file mode 100644 index 0000000000000..d360ea26e0c43 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/OperationsClient.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Lists the operations available from this provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list Microsoft.Authorization operations as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists the operations available from this provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list Microsoft.Authorization operations as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewDefaultSettingsClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewDefaultSettingsClient.java new file mode 100644 index 0000000000000..f2327ae81fc9e --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewDefaultSettingsClient.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewDefaultSettingsInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewScheduleSettings; + +/** + * An instance of this class provides access to all the operations defined in ScopeAccessReviewDefaultSettingsClient. + */ +public interface ScopeAccessReviewDefaultSettingsClient { + /** + * Get access review default settings for the subscription. + * + * @param scope The scope of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review default settings for the subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessReviewDefaultSettingsInner get(String scope); + + /** + * Get access review default settings for the subscription. + * + * @param scope The scope of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review default settings for the subscription along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String scope, Context context); + + /** + * Get access review default settings for the subscription. + * + * @param scope The scope of the resource. + * @param properties Access review schedule settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review default settings for the subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessReviewDefaultSettingsInner put(String scope, AccessReviewScheduleSettings properties); + + /** + * Get access review default settings for the subscription. + * + * @param scope The scope of the resource. + * @param properties Access review schedule settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review default settings for the subscription along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response putWithResponse( + String scope, AccessReviewScheduleSettings properties, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewHistoryDefinitionInstancesClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewHistoryDefinitionInstancesClient.java new file mode 100644 index 0000000000000..20a2ee93476f1 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewHistoryDefinitionInstancesClient.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryInstanceInner; + +/** + * An instance of this class provides access to all the operations defined in + * ScopeAccessReviewHistoryDefinitionInstancesClient. + */ +public interface ScopeAccessReviewHistoryDefinitionInstancesClient { + /** + * 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 scope The scope of the resource. + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review History Definition Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessReviewHistoryInstanceInner generateDownloadUri(String scope, String historyDefinitionId, String instanceId); + + /** + * 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 scope The scope of the resource. + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review History Definition Instance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response generateDownloadUriWithResponse( + String scope, String historyDefinitionId, String instanceId, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewHistoryDefinitionInstancesOperationsClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewHistoryDefinitionInstancesOperationsClient.java new file mode 100644 index 0000000000000..dcca77dc2579e --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewHistoryDefinitionInstancesOperationsClient.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryInstanceInner; + +/** + * An instance of this class provides access to all the operations defined in + * ScopeAccessReviewHistoryDefinitionInstancesOperationsClient. + */ +public interface ScopeAccessReviewHistoryDefinitionInstancesOperationsClient { + /** + * Get access review history definition instances by definition Id. + * + * @param scope The scope of the resource. + * @param historyDefinitionId The id of the access review history definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review history definition instances by definition Id as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String scope, String historyDefinitionId); + + /** + * Get access review history definition instances by definition Id. + * + * @param scope The scope of the resource. + * @param historyDefinitionId The id of the access review history definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review history definition instances by definition Id as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String scope, String historyDefinitionId, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewHistoryDefinitionOperationsClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewHistoryDefinitionOperationsClient.java new file mode 100644 index 0000000000000..ed4a4ad725f28 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewHistoryDefinitionOperationsClient.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryDefinitionInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryDefinitionProperties; + +/** + * An instance of this class provides access to all the operations defined in + * ScopeAccessReviewHistoryDefinitionOperationsClient. + */ +public interface ScopeAccessReviewHistoryDefinitionOperationsClient { + /** + * Create a scheduled or one-time Access Review History Definition. + * + * @param scope The scope of the resource. + * @param historyDefinitionId The id of the access review history definition. + * @param properties Access review history definition properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review History Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessReviewHistoryDefinitionInner create( + String scope, String historyDefinitionId, AccessReviewHistoryDefinitionProperties properties); + + /** + * Create a scheduled or one-time Access Review History Definition. + * + * @param scope The scope of the resource. + * @param historyDefinitionId The id of the access review history definition. + * @param properties Access review history definition properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review History Definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String scope, String historyDefinitionId, AccessReviewHistoryDefinitionProperties properties, Context context); + + /** + * Delete an access review history definition. + * + * @param scope The scope of the resource. + * @param historyDefinitionId The id of the access review history definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteById(String scope, String historyDefinitionId); + + /** + * Delete an access review history definition. + * + * @param scope The scope of the resource. + * @param historyDefinitionId The id of the access review history definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteByIdWithResponse(String scope, String historyDefinitionId, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewHistoryDefinitionsClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewHistoryDefinitionsClient.java new file mode 100644 index 0000000000000..8380f60fb3c27 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewHistoryDefinitionsClient.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryDefinitionInner; + +/** + * An instance of this class provides access to all the operations defined in ScopeAccessReviewHistoryDefinitionsClient. + */ +public interface ScopeAccessReviewHistoryDefinitionsClient { + /** + * Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available + * for 30 days after creation. + * + * @param scope The scope of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review History Definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String scope); + + /** + * Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available + * for 30 days after creation. + * + * @param scope The scope of the resource. + * @param filter The filter to apply on the operation. Only standard filters on definition name and created date are + * supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review History Definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String scope, String filter, Context context); + + /** + * Get access review history definition by definition Id. + * + * @param scope The scope of the resource. + * @param historyDefinitionId The id of the access review history definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review history definition by definition Id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessReviewHistoryDefinitionInner getById(String scope, String historyDefinitionId); + + /** + * Get access review history definition by definition Id. + * + * @param scope The scope of the resource. + * @param historyDefinitionId The id of the access review history definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review history definition by definition Id along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByIdWithResponse( + String scope, String historyDefinitionId, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewInstanceContactedReviewersClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewInstanceContactedReviewersClient.java new file mode 100644 index 0000000000000..4ffb0135d5269 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewInstanceContactedReviewersClient.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewContactedReviewerInner; + +/** + * An instance of this class provides access to all the operations defined in + * ScopeAccessReviewInstanceContactedReviewersClient. + */ +public interface ScopeAccessReviewInstanceContactedReviewersClient { + /** + * Get access review instance contacted reviewers. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance contacted reviewers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String scope, String scheduleDefinitionId, String id); + + /** + * Get access review instance contacted reviewers. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance contacted reviewers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String scope, String scheduleDefinitionId, String id, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewInstanceDecisionsClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewInstanceDecisionsClient.java new file mode 100644 index 0000000000000..f933d8f8ad627 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewInstanceDecisionsClient.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewDecisionInner; + +/** + * An instance of this class provides access to all the operations defined in ScopeAccessReviewInstanceDecisionsClient. + */ +public interface ScopeAccessReviewInstanceDecisionsClient { + /** + * Get access review instance decisions. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance decisions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String scope, String scheduleDefinitionId, String id); + + /** + * Get access review instance decisions. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance decisions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String scope, String scheduleDefinitionId, String id, String filter, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewInstanceOperationsClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewInstanceOperationsClient.java new file mode 100644 index 0000000000000..932b2f95e2628 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewInstanceOperationsClient.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.models.RecordAllDecisionsProperties; + +/** + * An instance of this class provides access to all the operations defined in ScopeAccessReviewInstanceOperationsClient. + */ +public interface ScopeAccessReviewInstanceOperationsClient { + /** + * An action to stop an access review instance. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void stop(String scope, String scheduleDefinitionId, String id); + + /** + * An action to stop an access review instance. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response stopWithResponse(String scope, String scheduleDefinitionId, String id, Context context); + + /** + * An action to approve/deny all decisions for a review with certain filters. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param properties Record all decisions payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void recordAllDecisions( + String scope, String scheduleDefinitionId, String id, RecordAllDecisionsProperties properties); + + /** + * An action to approve/deny all decisions for a review with certain filters. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param properties Record all decisions payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response recordAllDecisionsWithResponse( + String scope, String scheduleDefinitionId, String id, RecordAllDecisionsProperties properties, Context context); + + /** + * An action to reset all decisions for an access review instance. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void resetDecisions(String scope, String scheduleDefinitionId, String id); + + /** + * An action to reset all decisions for an access review instance. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response resetDecisionsWithResponse(String scope, String scheduleDefinitionId, String id, Context context); + + /** + * An action to apply all decisions for an access review instance. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void applyDecisions(String scope, String scheduleDefinitionId, String id); + + /** + * An action to apply all decisions for an access review instance. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response applyDecisionsWithResponse(String scope, String scheduleDefinitionId, String id, Context context); + + /** + * An action to send reminders for an access review instance. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void sendReminders(String scope, String scheduleDefinitionId, String id); + + /** + * An action to send reminders for an access review instance. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response sendRemindersWithResponse(String scope, String scheduleDefinitionId, String id, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewInstancesClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewInstancesClient.java new file mode 100644 index 0000000000000..7cb615c780de7 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewInstancesClient.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewInstanceInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewInstanceProperties; + +/** An instance of this class provides access to all the operations defined in ScopeAccessReviewInstancesClient. */ +public interface ScopeAccessReviewInstancesClient { + /** + * Get access review instances. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String scope, String scheduleDefinitionId); + + /** + * Get access review instances. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String scope, String scheduleDefinitionId, String filter, Context context); + + /** + * Get access review instances. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessReviewInstanceInner getById(String scope, String scheduleDefinitionId, String id); + + /** + * Get access review instances. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByIdWithResponse( + String scope, String scheduleDefinitionId, String id, Context context); + + /** + * Update access review instance. + * + * @param scope The scope of the resource. + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessReviewInstanceInner create( + String scope, String scheduleDefinitionId, String id, AccessReviewInstanceProperties properties); + + /** + * Update access review instance. + * + * @param scope The scope of the resource. + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review Instance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String scope, + String scheduleDefinitionId, + String id, + AccessReviewInstanceProperties properties, + Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewScheduleDefinitionsClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewScheduleDefinitionsClient.java new file mode 100644 index 0000000000000..5ccbfc7ff246b --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ScopeAccessReviewScheduleDefinitionsClient.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewScheduleDefinitionInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewScheduleDefinitionProperties; + +/** + * An instance of this class provides access to all the operations defined in + * ScopeAccessReviewScheduleDefinitionsClient. + */ +public interface ScopeAccessReviewScheduleDefinitionsClient { + /** + * Get access review schedule definitions. + * + * @param scope The scope of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review schedule definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String scope); + + /** + * Get access review schedule definitions. + * + * @param scope The scope of the resource. + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review schedule definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String scope, String filter, Context context); + + /** + * Get single access review definition. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single access review definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessReviewScheduleDefinitionInner getById(String scope, String scheduleDefinitionId); + + /** + * Get single access review definition. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single access review definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByIdWithResponse( + String scope, String scheduleDefinitionId, Context context); + + /** + * Delete access review schedule definition. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteById(String scope, String scheduleDefinitionId); + + /** + * Delete access review schedule definition. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteByIdWithResponse(String scope, String scheduleDefinitionId, Context context); + + /** + * Create or Update access review schedule definition. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param properties Access review schedule definition properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review Schedule Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessReviewScheduleDefinitionInner createOrUpdateById( + String scope, String scheduleDefinitionId, AccessReviewScheduleDefinitionProperties properties); + + /** + * Create or Update access review schedule definition. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param properties Access review schedule definition properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review Schedule Definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateByIdWithResponse( + String scope, + String scheduleDefinitionId, + AccessReviewScheduleDefinitionProperties properties, + Context context); + + /** + * Stop access review definition. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void stop(String scope, String scheduleDefinitionId); + + /** + * Stop access review definition. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response stopWithResponse(String scope, String scheduleDefinitionId, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/TenantLevelAccessReviewInstanceContactedReviewersClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/TenantLevelAccessReviewInstanceContactedReviewersClient.java new file mode 100644 index 0000000000000..ef695f5331f48 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/TenantLevelAccessReviewInstanceContactedReviewersClient.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewContactedReviewerInner; + +/** + * An instance of this class provides access to all the operations defined in + * TenantLevelAccessReviewInstanceContactedReviewersClient. + */ +public interface TenantLevelAccessReviewInstanceContactedReviewersClient { + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance contacted reviewers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String scheduleDefinitionId, String id); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance contacted reviewers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String scheduleDefinitionId, String id, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewActorIdentity.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewActorIdentity.java new file mode 100644 index 0000000000000..9af205e0834ab --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewActorIdentity.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewActorIdentityType; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Details of the actor identity. */ +@Immutable +public class AccessReviewActorIdentity { + /* + * The identity id + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The identity type : user/servicePrincipal + */ + @JsonProperty(value = "principalType", access = JsonProperty.Access.WRITE_ONLY) + private AccessReviewActorIdentityType principalType; + + /* + * The identity display name + */ + @JsonProperty(value = "principalName", access = JsonProperty.Access.WRITE_ONLY) + private String principalName; + + /* + * The user principal name(if valid) + */ + @JsonProperty(value = "userPrincipalName", access = JsonProperty.Access.WRITE_ONLY) + private String userPrincipalName; + + /** + * Get the principalId property: The identity id. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the principalType property: The identity type : user/servicePrincipal. + * + * @return the principalType value. + */ + public AccessReviewActorIdentityType principalType() { + return this.principalType; + } + + /** + * Get the principalName property: The identity display name. + * + * @return the principalName value. + */ + public String principalName() { + return this.principalName; + } + + /** + * Get the userPrincipalName property: The user principal name(if valid). + * + * @return the userPrincipalName value. + */ + public String userPrincipalName() { + return this.userPrincipalName; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewContactedReviewerInner.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewContactedReviewerInner.java new file mode 100644 index 0000000000000..35c8b40137017 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewContactedReviewerInner.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Access Review Contacted Reviewer. */ +@Fluent +public final class AccessReviewContactedReviewerInner extends ProxyResource { + /* + * Access Review Contacted Reviewer properties. + */ + @JsonProperty(value = "properties") + private AccessReviewContactedReviewerProperties innerProperties; + + /** + * Get the innerProperties property: Access Review Contacted Reviewer properties. + * + * @return the innerProperties value. + */ + private AccessReviewContactedReviewerProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the userDisplayName property: The display name of the reviewer. + * + * @return the userDisplayName value. + */ + public String userDisplayName() { + return this.innerProperties() == null ? null : this.innerProperties().userDisplayName(); + } + + /** + * Get the userPrincipalName property: The user principal name of the reviewer. + * + * @return the userPrincipalName value. + */ + public String userPrincipalName() { + return this.innerProperties() == null ? null : this.innerProperties().userPrincipalName(); + } + + /** + * Get the createdDateTime property: Date Time when the reviewer was contacted. + * + * @return the createdDateTime value. + */ + public OffsetDateTime createdDateTime() { + return this.innerProperties() == null ? null : this.innerProperties().createdDateTime(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewContactedReviewerProperties.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewContactedReviewerProperties.java new file mode 100644 index 0000000000000..ac0a4acf7adbc --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewContactedReviewerProperties.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Properties of access review contacted reviewer. */ +@Immutable +public final class AccessReviewContactedReviewerProperties { + /* + * The display name of the reviewer + */ + @JsonProperty(value = "userDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String userDisplayName; + + /* + * The user principal name of the reviewer + */ + @JsonProperty(value = "userPrincipalName", access = JsonProperty.Access.WRITE_ONLY) + private String userPrincipalName; + + /* + * Date Time when the reviewer was contacted. + */ + @JsonProperty(value = "createdDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDateTime; + + /** + * Get the userDisplayName property: The display name of the reviewer. + * + * @return the userDisplayName value. + */ + public String userDisplayName() { + return this.userDisplayName; + } + + /** + * Get the userPrincipalName property: The user principal name of the reviewer. + * + * @return the userPrincipalName value. + */ + public String userPrincipalName() { + return this.userPrincipalName; + } + + /** + * Get the createdDateTime property: Date Time when the reviewer was contacted. + * + * @return the createdDateTime value. + */ + public OffsetDateTime createdDateTime() { + return this.createdDateTime; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewDecisionIdentity.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewDecisionIdentity.java new file mode 100644 index 0000000000000..c0b3f00cce3f1 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewDecisionIdentity.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewDecisionServicePrincipalIdentity; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewDecisionUserIdentity; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Target of the decision. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + defaultImpl = AccessReviewDecisionIdentity.class) +@JsonTypeName("AccessReviewDecisionIdentity") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "user", value = AccessReviewDecisionUserIdentity.class), + @JsonSubTypes.Type(name = "servicePrincipal", value = AccessReviewDecisionServicePrincipalIdentity.class) +}) +@Immutable +public class AccessReviewDecisionIdentity { + /* + * The id of principal whose access was reviewed. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The display name of the user whose access was reviewed. + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /** + * Get the id property: The id of principal whose access was reviewed. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the displayName property: The display name of the user whose access was reviewed. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewDecisionInner.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewDecisionInner.java new file mode 100644 index 0000000000000..381d41106edaf --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewDecisionInner.java @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.authorization.generated.models.AccessRecommendationType; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewActorIdentityType; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewApplyResult; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewDecisionInsight; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewDecisionPrincipalResourceMembershipType; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewResult; +import com.azure.resourcemanager.authorization.generated.models.DecisionResourceType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Access Review. */ +@Fluent +public final class AccessReviewDecisionInner extends ProxyResource { + /* + * Access Review Decision properties. + */ + @JsonProperty(value = "properties") + private AccessReviewDecisionProperties innerProperties; + + /** + * Get the innerProperties property: Access Review Decision properties. + * + * @return the innerProperties value. + */ + private AccessReviewDecisionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the recommendation property: The feature- generated recommendation shown to the reviewer. + * + * @return the recommendation value. + */ + public AccessRecommendationType recommendation() { + return this.innerProperties() == null ? null : this.innerProperties().recommendation(); + } + + /** + * Get the decision property: The decision on the approval step. This value is initially set to NotReviewed. + * Approvers can take action of Approve/Deny. + * + * @return the decision value. + */ + public AccessReviewResult decision() { + return this.innerProperties() == null ? null : this.innerProperties().decision(); + } + + /** + * Set the decision property: The decision on the approval step. This value is initially set to NotReviewed. + * Approvers can take action of Approve/Deny. + * + * @param decision the decision value to set. + * @return the AccessReviewDecisionInner object itself. + */ + public AccessReviewDecisionInner withDecision(AccessReviewResult decision) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewDecisionProperties(); + } + this.innerProperties().withDecision(decision); + return this; + } + + /** + * Get the justification property: Justification provided by approvers for their action. + * + * @return the justification value. + */ + public String justification() { + return this.innerProperties() == null ? null : this.innerProperties().justification(); + } + + /** + * Set the justification property: Justification provided by approvers for their action. + * + * @param justification the justification value to set. + * @return the AccessReviewDecisionInner object itself. + */ + public AccessReviewDecisionInner withJustification(String justification) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewDecisionProperties(); + } + this.innerProperties().withJustification(justification); + return this; + } + + /** + * Get the reviewedDateTime property: Date Time when a decision was taken. + * + * @return the reviewedDateTime value. + */ + public OffsetDateTime reviewedDateTime() { + return this.innerProperties() == null ? null : this.innerProperties().reviewedDateTime(); + } + + /** + * Get the applyResult property: The outcome of applying the decision. + * + * @return the applyResult value. + */ + public AccessReviewApplyResult applyResult() { + return this.innerProperties() == null ? null : this.innerProperties().applyResult(); + } + + /** + * Get the appliedDateTime property: The date and time when the review decision was applied. + * + * @return the appliedDateTime value. + */ + public OffsetDateTime appliedDateTime() { + return this.innerProperties() == null ? null : this.innerProperties().appliedDateTime(); + } + + /** + * Get the insights property: This is the collection of insights for this decision item. + * + * @return the insights value. + */ + public List insights() { + return this.innerProperties() == null ? null : this.innerProperties().insights(); + } + + /** + * Set the insights property: This is the collection of insights for this decision item. + * + * @param insights the insights value to set. + * @return the AccessReviewDecisionInner object itself. + */ + public AccessReviewDecisionInner withInsights(List insights) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewDecisionProperties(); + } + this.innerProperties().withInsights(insights); + return this; + } + + /** + * Get the id property: The id of principal whose access was reviewed. + * + * @return the id value. + */ + public String idPropertiesId() { + return this.innerProperties() == null ? null : this.innerProperties().id(); + } + + /** + * Get the displayName property: The display name of the user whose access was reviewed. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Get the type property: The type of resource. + * + * @return the type value. + */ + public DecisionResourceType typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Get the idResourceId property: The id of resource associated with a decision record. + * + * @return the idResourceId value. + */ + public String idResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().idResourceId(); + } + + /** + * Get the displayNameResourceDisplayName property: The display name of resource associated with a decision record. + * + * @return the displayNameResourceDisplayName value. + */ + public String displayNameResourceDisplayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayNameResourceDisplayName(); + } + + /** + * Get the principalId property: The identity id. + * + * @return the principalId value. + */ + public String principalId() { + return this.innerProperties() == null ? null : this.innerProperties().principalId(); + } + + /** + * Get the principalType property: The identity type : user/servicePrincipal. + * + * @return the principalType value. + */ + public AccessReviewActorIdentityType principalType() { + return this.innerProperties() == null ? null : this.innerProperties().principalType(); + } + + /** + * Get the principalName property: The identity display name. + * + * @return the principalName value. + */ + public String principalName() { + return this.innerProperties() == null ? null : this.innerProperties().principalName(); + } + + /** + * Get the userPrincipalName property: The user principal name(if valid). + * + * @return the userPrincipalName value. + */ + public String userPrincipalName() { + return this.innerProperties() == null ? null : this.innerProperties().userPrincipalName(); + } + + /** + * Get the principalIdAppliedByPrincipalId property: The identity id. + * + * @return the principalIdAppliedByPrincipalId value. + */ + public String principalIdAppliedByPrincipalId() { + return this.innerProperties() == null ? null : this.innerProperties().principalIdAppliedByPrincipalId(); + } + + /** + * Get the principalTypeAppliedByPrincipalType property: The identity type : user/servicePrincipal. + * + * @return the principalTypeAppliedByPrincipalType value. + */ + public AccessReviewActorIdentityType principalTypeAppliedByPrincipalType() { + return this.innerProperties() == null ? null : this.innerProperties().principalTypeAppliedByPrincipalType(); + } + + /** + * Get the principalNameAppliedByPrincipalName property: The identity display name. + * + * @return the principalNameAppliedByPrincipalName value. + */ + public String principalNameAppliedByPrincipalName() { + return this.innerProperties() == null ? null : this.innerProperties().principalNameAppliedByPrincipalName(); + } + + /** + * Get the userPrincipalNameAppliedByUserPrincipalName property: The user principal name(if valid). + * + * @return the userPrincipalNameAppliedByUserPrincipalName value. + */ + public String userPrincipalNameAppliedByUserPrincipalName() { + return this.innerProperties() == null + ? null + : this.innerProperties().userPrincipalNameAppliedByUserPrincipalName(); + } + + /** + * Get the membershipTypes property: Every decision item in an access review represents a principal's membership to + * a resource. This property represents details of the membership. Examples of this detail might be whether the + * principal has direct access or indirect access. + * + * @return the membershipTypes value. + */ + public List membershipTypes() { + return this.innerProperties() == null ? null : this.innerProperties().membershipTypes(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewDecisionInsightProperties.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewDecisionInsightProperties.java new file mode 100644 index 0000000000000..50144d21d4887 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewDecisionInsightProperties.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewDecisionUserSignInInsightProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Details of the Insight. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + defaultImpl = AccessReviewDecisionInsightProperties.class) +@JsonTypeName("AccessReviewDecisionInsightProperties") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "userSignInInsight", value = AccessReviewDecisionUserSignInInsightProperties.class) +}) +@Immutable +public class AccessReviewDecisionInsightProperties { + /* + * Date Time when the insight was created. + */ + @JsonProperty(value = "insightCreatedDateTime", access = JsonProperty.Access.WRITE_ONLY) + private Object insightCreatedDateTime; + + /** + * Get the insightCreatedDateTime property: Date Time when the insight was created. + * + * @return the insightCreatedDateTime value. + */ + public Object insightCreatedDateTime() { + return this.insightCreatedDateTime; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewDecisionPrincipalResourceMembership.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewDecisionPrincipalResourceMembership.java new file mode 100644 index 0000000000000..166c612570b17 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewDecisionPrincipalResourceMembership.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewDecisionPrincipalResourceMembershipType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Target of the decision. */ +@Fluent +public final class AccessReviewDecisionPrincipalResourceMembership { + /* + * Every decision item in an access review represents a principal's membership to a resource. This property + * represents details of the membership. Examples of this detail might be whether the principal has direct access + * or indirect access + */ + @JsonProperty(value = "membershipTypes") + private List membershipTypes; + + /** + * Get the membershipTypes property: Every decision item in an access review represents a principal's membership to + * a resource. This property represents details of the membership. Examples of this detail might be whether the + * principal has direct access or indirect access. + * + * @return the membershipTypes value. + */ + public List membershipTypes() { + return this.membershipTypes; + } + + /** + * Set the membershipTypes property: Every decision item in an access review represents a principal's membership to + * a resource. This property represents details of the membership. Examples of this detail might be whether the + * principal has direct access or indirect access. + * + * @param membershipTypes the membershipTypes value to set. + * @return the AccessReviewDecisionPrincipalResourceMembership object itself. + */ + public AccessReviewDecisionPrincipalResourceMembership withMembershipTypes( + List membershipTypes) { + this.membershipTypes = membershipTypes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewDecisionProperties.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewDecisionProperties.java new file mode 100644 index 0000000000000..4ff7d8451ed37 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewDecisionProperties.java @@ -0,0 +1,426 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.authorization.generated.models.AccessRecommendationType; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewActorIdentityType; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewApplyResult; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewDecisionInsight; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewDecisionPrincipalResourceMembershipType; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewResult; +import com.azure.resourcemanager.authorization.generated.models.DecisionResourceType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Approval Step. */ +@Fluent +public final class AccessReviewDecisionProperties { + /* + * Principal associated with the decision record. Can be AccessReviewDecisionUserIdentity or + * AccessReviewDecisionServicePrincipalIdentity + */ + @JsonProperty(value = "principal", access = JsonProperty.Access.WRITE_ONLY) + private AccessReviewDecisionIdentity innerPrincipal; + + /* + * Resource associated with this decision record. + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private AccessReviewDecisionResource innerResource; + + /* + * The feature- generated recommendation shown to the reviewer. + */ + @JsonProperty(value = "recommendation", access = JsonProperty.Access.WRITE_ONLY) + private AccessRecommendationType recommendation; + + /* + * The decision on the approval step. This value is initially set to NotReviewed. Approvers can take action of + * Approve/Deny + */ + @JsonProperty(value = "decision") + private AccessReviewResult decision; + + /* + * Justification provided by approvers for their action + */ + @JsonProperty(value = "justification") + private String justification; + + /* + * Date Time when a decision was taken. + */ + @JsonProperty(value = "reviewedDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime reviewedDateTime; + + /* + * Details of the approver. + */ + @JsonProperty(value = "reviewedBy", access = JsonProperty.Access.WRITE_ONLY) + private AccessReviewActorIdentity innerReviewedBy; + + /* + * The outcome of applying the decision. + */ + @JsonProperty(value = "applyResult", access = JsonProperty.Access.WRITE_ONLY) + private AccessReviewApplyResult applyResult; + + /* + * The date and time when the review decision was applied. + */ + @JsonProperty(value = "appliedDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime appliedDateTime; + + /* + * Details of the approver. + */ + @JsonProperty(value = "appliedBy", access = JsonProperty.Access.WRITE_ONLY) + private AccessReviewActorIdentity innerAppliedBy; + + /* + * This is the collection of insights for this decision item. + */ + @JsonProperty(value = "insights") + private List insights; + + /* + * Details of the membership type. + */ + @JsonProperty(value = "principalResourceMembership", access = JsonProperty.Access.WRITE_ONLY) + private AccessReviewDecisionPrincipalResourceMembership innerPrincipalResourceMembership; + + /** + * Get the innerPrincipal property: Principal associated with the decision record. Can be + * AccessReviewDecisionUserIdentity or AccessReviewDecisionServicePrincipalIdentity. + * + * @return the innerPrincipal value. + */ + private AccessReviewDecisionIdentity innerPrincipal() { + return this.innerPrincipal; + } + + /** + * Get the innerResource property: Resource associated with this decision record. + * + * @return the innerResource value. + */ + private AccessReviewDecisionResource innerResource() { + return this.innerResource; + } + + /** + * Get the recommendation property: The feature- generated recommendation shown to the reviewer. + * + * @return the recommendation value. + */ + public AccessRecommendationType recommendation() { + return this.recommendation; + } + + /** + * Get the decision property: The decision on the approval step. This value is initially set to NotReviewed. + * Approvers can take action of Approve/Deny. + * + * @return the decision value. + */ + public AccessReviewResult decision() { + return this.decision; + } + + /** + * Set the decision property: The decision on the approval step. This value is initially set to NotReviewed. + * Approvers can take action of Approve/Deny. + * + * @param decision the decision value to set. + * @return the AccessReviewDecisionProperties object itself. + */ + public AccessReviewDecisionProperties withDecision(AccessReviewResult decision) { + this.decision = decision; + return this; + } + + /** + * Get the justification property: Justification provided by approvers for their action. + * + * @return the justification value. + */ + public String justification() { + return this.justification; + } + + /** + * Set the justification property: Justification provided by approvers for their action. + * + * @param justification the justification value to set. + * @return the AccessReviewDecisionProperties object itself. + */ + public AccessReviewDecisionProperties withJustification(String justification) { + this.justification = justification; + return this; + } + + /** + * Get the reviewedDateTime property: Date Time when a decision was taken. + * + * @return the reviewedDateTime value. + */ + public OffsetDateTime reviewedDateTime() { + return this.reviewedDateTime; + } + + /** + * Get the innerReviewedBy property: Details of the approver. + * + * @return the innerReviewedBy value. + */ + private AccessReviewActorIdentity innerReviewedBy() { + return this.innerReviewedBy; + } + + /** + * Get the applyResult property: The outcome of applying the decision. + * + * @return the applyResult value. + */ + public AccessReviewApplyResult applyResult() { + return this.applyResult; + } + + /** + * Get the appliedDateTime property: The date and time when the review decision was applied. + * + * @return the appliedDateTime value. + */ + public OffsetDateTime appliedDateTime() { + return this.appliedDateTime; + } + + /** + * Get the innerAppliedBy property: Details of the approver. + * + * @return the innerAppliedBy value. + */ + private AccessReviewActorIdentity innerAppliedBy() { + return this.innerAppliedBy; + } + + /** + * Get the insights property: This is the collection of insights for this decision item. + * + * @return the insights value. + */ + public List insights() { + return this.insights; + } + + /** + * Set the insights property: This is the collection of insights for this decision item. + * + * @param insights the insights value to set. + * @return the AccessReviewDecisionProperties object itself. + */ + public AccessReviewDecisionProperties withInsights(List insights) { + this.insights = insights; + return this; + } + + /** + * Get the innerPrincipalResourceMembership property: Details of the membership type. + * + * @return the innerPrincipalResourceMembership value. + */ + private AccessReviewDecisionPrincipalResourceMembership innerPrincipalResourceMembership() { + return this.innerPrincipalResourceMembership; + } + + /** + * Get the id property: The id of principal whose access was reviewed. + * + * @return the id value. + */ + public String id() { + return this.innerPrincipal() == null ? null : this.innerPrincipal().id(); + } + + /** + * Get the displayName property: The display name of the user whose access was reviewed. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerPrincipal() == null ? null : this.innerPrincipal().displayName(); + } + + /** + * Get the type property: The type of resource. + * + * @return the type value. + */ + public DecisionResourceType type() { + return this.innerResource() == null ? null : this.innerResource().type(); + } + + /** + * Set the type property: The type of resource. + * + * @param type the type value to set. + * @return the AccessReviewDecisionProperties object itself. + */ + public AccessReviewDecisionProperties withType(DecisionResourceType type) { + if (this.innerResource() == null) { + this.innerResource = new AccessReviewDecisionResource(); + } + this.innerResource().withType(type); + return this; + } + + /** + * Get the id property: The id of resource associated with a decision record. + * + * @return the id value. + */ + public String idResourceId() { + return this.innerResource() == null ? null : this.innerResource().id(); + } + + /** + * Get the displayName property: The display name of resource associated with a decision record. + * + * @return the displayName value. + */ + public String displayNameResourceDisplayName() { + return this.innerResource() == null ? null : this.innerResource().displayName(); + } + + /** + * Get the principalId property: The identity id. + * + * @return the principalId value. + */ + public String principalId() { + return this.innerReviewedBy() == null ? null : this.innerReviewedBy().principalId(); + } + + /** + * Get the principalType property: The identity type : user/servicePrincipal. + * + * @return the principalType value. + */ + public AccessReviewActorIdentityType principalType() { + return this.innerReviewedBy() == null ? null : this.innerReviewedBy().principalType(); + } + + /** + * Get the principalName property: The identity display name. + * + * @return the principalName value. + */ + public String principalName() { + return this.innerReviewedBy() == null ? null : this.innerReviewedBy().principalName(); + } + + /** + * Get the userPrincipalName property: The user principal name(if valid). + * + * @return the userPrincipalName value. + */ + public String userPrincipalName() { + return this.innerReviewedBy() == null ? null : this.innerReviewedBy().userPrincipalName(); + } + + /** + * Get the principalId property: The identity id. + * + * @return the principalId value. + */ + public String principalIdAppliedByPrincipalId() { + return this.innerAppliedBy() == null ? null : this.innerAppliedBy().principalId(); + } + + /** + * Get the principalType property: The identity type : user/servicePrincipal. + * + * @return the principalType value. + */ + public AccessReviewActorIdentityType principalTypeAppliedByPrincipalType() { + return this.innerAppliedBy() == null ? null : this.innerAppliedBy().principalType(); + } + + /** + * Get the principalName property: The identity display name. + * + * @return the principalName value. + */ + public String principalNameAppliedByPrincipalName() { + return this.innerAppliedBy() == null ? null : this.innerAppliedBy().principalName(); + } + + /** + * Get the userPrincipalName property: The user principal name(if valid). + * + * @return the userPrincipalName value. + */ + public String userPrincipalNameAppliedByUserPrincipalName() { + return this.innerAppliedBy() == null ? null : this.innerAppliedBy().userPrincipalName(); + } + + /** + * Get the membershipTypes property: Every decision item in an access review represents a principal's membership to + * a resource. This property represents details of the membership. Examples of this detail might be whether the + * principal has direct access or indirect access. + * + * @return the membershipTypes value. + */ + public List membershipTypes() { + return this.innerPrincipalResourceMembership() == null + ? null + : this.innerPrincipalResourceMembership().membershipTypes(); + } + + /** + * Set the membershipTypes property: Every decision item in an access review represents a principal's membership to + * a resource. This property represents details of the membership. Examples of this detail might be whether the + * principal has direct access or indirect access. + * + * @param membershipTypes the membershipTypes value to set. + * @return the AccessReviewDecisionProperties object itself. + */ + public AccessReviewDecisionProperties withMembershipTypes( + List membershipTypes) { + if (this.innerPrincipalResourceMembership() == null) { + this.innerPrincipalResourceMembership = new AccessReviewDecisionPrincipalResourceMembership(); + } + this.innerPrincipalResourceMembership().withMembershipTypes(membershipTypes); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerPrincipal() != null) { + innerPrincipal().validate(); + } + if (innerResource() != null) { + innerResource().validate(); + } + if (innerReviewedBy() != null) { + innerReviewedBy().validate(); + } + if (innerAppliedBy() != null) { + innerAppliedBy().validate(); + } + if (insights() != null) { + insights().forEach(e -> e.validate()); + } + if (innerPrincipalResourceMembership() != null) { + innerPrincipalResourceMembership().validate(); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewDecisionResource.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewDecisionResource.java new file mode 100644 index 0000000000000..e911511cef9c3 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewDecisionResource.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.authorization.generated.models.DecisionResourceType; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Target of the decision. */ +@Fluent +public final class AccessReviewDecisionResource { + /* + * The type of resource + */ + @JsonProperty(value = "type", required = true) + private DecisionResourceType type; + + /* + * The id of resource associated with a decision record. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The display name of resource associated with a decision record. + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /** + * Get the type property: The type of resource. + * + * @return the type value. + */ + public DecisionResourceType type() { + return this.type; + } + + /** + * Set the type property: The type of resource. + * + * @param type the type value to set. + * @return the AccessReviewDecisionResource object itself. + */ + public AccessReviewDecisionResource withType(DecisionResourceType type) { + this.type = type; + return this; + } + + /** + * Get the id property: The id of resource associated with a decision record. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the displayName property: The display name of resource associated with a decision record. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property type in model AccessReviewDecisionResource")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AccessReviewDecisionResource.class); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewDefaultSettingsInner.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewDefaultSettingsInner.java new file mode 100644 index 0000000000000..7c281d154b5c2 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewDefaultSettingsInner.java @@ -0,0 +1,423 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewRecurrencePatternType; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewRecurrenceRangeType; +import com.azure.resourcemanager.authorization.generated.models.DefaultDecisionType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; +import java.time.OffsetDateTime; + +/** Access Review Default Settings. */ +@Fluent +public final class AccessReviewDefaultSettingsInner extends ProxyResource { + /* + * Access Review properties. + */ + @JsonProperty(value = "properties") + private AccessReviewScheduleSettings innerProperties; + + /** + * Get the innerProperties property: Access Review properties. + * + * @return the innerProperties value. + */ + private AccessReviewScheduleSettings innerProperties() { + return this.innerProperties; + } + + /** + * Get the mailNotificationsEnabled property: Flag to indicate whether sending mails to reviewers and the review + * creator is enabled. + * + * @return the mailNotificationsEnabled value. + */ + public Boolean mailNotificationsEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().mailNotificationsEnabled(); + } + + /** + * Set the mailNotificationsEnabled property: Flag to indicate whether sending mails to reviewers and the review + * creator is enabled. + * + * @param mailNotificationsEnabled the mailNotificationsEnabled value to set. + * @return the AccessReviewDefaultSettingsInner object itself. + */ + public AccessReviewDefaultSettingsInner withMailNotificationsEnabled(Boolean mailNotificationsEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewScheduleSettings(); + } + this.innerProperties().withMailNotificationsEnabled(mailNotificationsEnabled); + return this; + } + + /** + * Get the reminderNotificationsEnabled property: Flag to indicate whether sending reminder emails to reviewers are + * enabled. + * + * @return the reminderNotificationsEnabled value. + */ + public Boolean reminderNotificationsEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().reminderNotificationsEnabled(); + } + + /** + * Set the reminderNotificationsEnabled property: Flag to indicate whether sending reminder emails to reviewers are + * enabled. + * + * @param reminderNotificationsEnabled the reminderNotificationsEnabled value to set. + * @return the AccessReviewDefaultSettingsInner object itself. + */ + public AccessReviewDefaultSettingsInner withReminderNotificationsEnabled(Boolean reminderNotificationsEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewScheduleSettings(); + } + this.innerProperties().withReminderNotificationsEnabled(reminderNotificationsEnabled); + return this; + } + + /** + * Get the defaultDecisionEnabled property: Flag to indicate whether reviewers are required to provide a + * justification when reviewing access. + * + * @return the defaultDecisionEnabled value. + */ + public Boolean defaultDecisionEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().defaultDecisionEnabled(); + } + + /** + * Set the defaultDecisionEnabled property: Flag to indicate whether reviewers are required to provide a + * justification when reviewing access. + * + * @param defaultDecisionEnabled the defaultDecisionEnabled value to set. + * @return the AccessReviewDefaultSettingsInner object itself. + */ + public AccessReviewDefaultSettingsInner withDefaultDecisionEnabled(Boolean defaultDecisionEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewScheduleSettings(); + } + this.innerProperties().withDefaultDecisionEnabled(defaultDecisionEnabled); + return this; + } + + /** + * Get the justificationRequiredOnApproval property: Flag to indicate whether the reviewer is required to pass + * justification when recording a decision. + * + * @return the justificationRequiredOnApproval value. + */ + public Boolean justificationRequiredOnApproval() { + return this.innerProperties() == null ? null : this.innerProperties().justificationRequiredOnApproval(); + } + + /** + * Set the justificationRequiredOnApproval property: Flag to indicate whether the reviewer is required to pass + * justification when recording a decision. + * + * @param justificationRequiredOnApproval the justificationRequiredOnApproval value to set. + * @return the AccessReviewDefaultSettingsInner object itself. + */ + public AccessReviewDefaultSettingsInner withJustificationRequiredOnApproval( + Boolean justificationRequiredOnApproval) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewScheduleSettings(); + } + this.innerProperties().withJustificationRequiredOnApproval(justificationRequiredOnApproval); + return this; + } + + /** + * Get the defaultDecision property: This specifies the behavior for the autoReview feature when an access review + * completes. + * + * @return the defaultDecision value. + */ + public DefaultDecisionType defaultDecision() { + return this.innerProperties() == null ? null : this.innerProperties().defaultDecision(); + } + + /** + * Set the defaultDecision property: This specifies the behavior for the autoReview feature when an access review + * completes. + * + * @param defaultDecision the defaultDecision value to set. + * @return the AccessReviewDefaultSettingsInner object itself. + */ + public AccessReviewDefaultSettingsInner withDefaultDecision(DefaultDecisionType defaultDecision) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewScheduleSettings(); + } + this.innerProperties().withDefaultDecision(defaultDecision); + return this; + } + + /** + * Get the autoApplyDecisionsEnabled property: 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. + * + * @return the autoApplyDecisionsEnabled value. + */ + public Boolean autoApplyDecisionsEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().autoApplyDecisionsEnabled(); + } + + /** + * Set the autoApplyDecisionsEnabled property: 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. + * + * @param autoApplyDecisionsEnabled the autoApplyDecisionsEnabled value to set. + * @return the AccessReviewDefaultSettingsInner object itself. + */ + public AccessReviewDefaultSettingsInner withAutoApplyDecisionsEnabled(Boolean autoApplyDecisionsEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewScheduleSettings(); + } + this.innerProperties().withAutoApplyDecisionsEnabled(autoApplyDecisionsEnabled); + return this; + } + + /** + * Get the recommendationsEnabled property: Flag to indicate whether showing recommendations to reviewers is + * enabled. + * + * @return the recommendationsEnabled value. + */ + public Boolean recommendationsEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().recommendationsEnabled(); + } + + /** + * Set the recommendationsEnabled property: Flag to indicate whether showing recommendations to reviewers is + * enabled. + * + * @param recommendationsEnabled the recommendationsEnabled value to set. + * @return the AccessReviewDefaultSettingsInner object itself. + */ + public AccessReviewDefaultSettingsInner withRecommendationsEnabled(Boolean recommendationsEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewScheduleSettings(); + } + this.innerProperties().withRecommendationsEnabled(recommendationsEnabled); + return this; + } + + /** + * Get the recommendationLookBackDuration property: 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)). + * + * @return the recommendationLookBackDuration value. + */ + public Duration recommendationLookBackDuration() { + return this.innerProperties() == null ? null : this.innerProperties().recommendationLookBackDuration(); + } + + /** + * Set the recommendationLookBackDuration property: 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)). + * + * @param recommendationLookBackDuration the recommendationLookBackDuration value to set. + * @return the AccessReviewDefaultSettingsInner object itself. + */ + public AccessReviewDefaultSettingsInner withRecommendationLookBackDuration( + Duration recommendationLookBackDuration) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewScheduleSettings(); + } + this.innerProperties().withRecommendationLookBackDuration(recommendationLookBackDuration); + return this; + } + + /** + * Get the instanceDurationInDays property: The duration in days for an instance. + * + * @return the instanceDurationInDays value. + */ + public Integer instanceDurationInDays() { + return this.innerProperties() == null ? null : this.innerProperties().instanceDurationInDays(); + } + + /** + * Set the instanceDurationInDays property: The duration in days for an instance. + * + * @param instanceDurationInDays the instanceDurationInDays value to set. + * @return the AccessReviewDefaultSettingsInner object itself. + */ + public AccessReviewDefaultSettingsInner withInstanceDurationInDays(Integer instanceDurationInDays) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewScheduleSettings(); + } + this.innerProperties().withInstanceDurationInDays(instanceDurationInDays); + return this; + } + + /** + * Get the type property: The recurrence type : weekly, monthly, etc. + * + * @return the type value. + */ + public AccessReviewRecurrencePatternType typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Set the type property: The recurrence type : weekly, monthly, etc. + * + * @param type the type value to set. + * @return the AccessReviewDefaultSettingsInner object itself. + */ + public AccessReviewDefaultSettingsInner withTypePropertiesType(AccessReviewRecurrencePatternType type) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewScheduleSettings(); + } + this.innerProperties().withType(type); + return this; + } + + /** + * Get the interval property: The interval for recurrence. For a quarterly review, the interval is 3 for type : + * absoluteMonthly. + * + * @return the interval value. + */ + public Integer interval() { + return this.innerProperties() == null ? null : this.innerProperties().interval(); + } + + /** + * Set the interval property: The interval for recurrence. For a quarterly review, the interval is 3 for type : + * absoluteMonthly. + * + * @param interval the interval value to set. + * @return the AccessReviewDefaultSettingsInner object itself. + */ + public AccessReviewDefaultSettingsInner withInterval(Integer interval) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewScheduleSettings(); + } + this.innerProperties().withInterval(interval); + return this; + } + + /** + * Get the typeRangeType property: The recurrence range type. The possible values are: endDate, noEnd, numbered. + * + * @return the typeRangeType value. + */ + public AccessReviewRecurrenceRangeType typeRangeType() { + return this.innerProperties() == null ? null : this.innerProperties().typeRangeType(); + } + + /** + * Set the typeRangeType property: The recurrence range type. The possible values are: endDate, noEnd, numbered. + * + * @param typeRangeType the typeRangeType value to set. + * @return the AccessReviewDefaultSettingsInner object itself. + */ + public AccessReviewDefaultSettingsInner withTypeRangeType(AccessReviewRecurrenceRangeType typeRangeType) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewScheduleSettings(); + } + this.innerProperties().withTypeRangeType(typeRangeType); + return this; + } + + /** + * Get the numberOfOccurrences property: The number of times to repeat the access review. Required and must be + * positive if type is numbered. + * + * @return the numberOfOccurrences value. + */ + public Integer numberOfOccurrences() { + return this.innerProperties() == null ? null : this.innerProperties().numberOfOccurrences(); + } + + /** + * Set the numberOfOccurrences property: The number of times to repeat the access review. Required and must be + * positive if type is numbered. + * + * @param numberOfOccurrences the numberOfOccurrences value to set. + * @return the AccessReviewDefaultSettingsInner object itself. + */ + public AccessReviewDefaultSettingsInner withNumberOfOccurrences(Integer numberOfOccurrences) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewScheduleSettings(); + } + this.innerProperties().withNumberOfOccurrences(numberOfOccurrences); + return this; + } + + /** + * Get the startDate property: The DateTime when the review is scheduled to be start. This could be a date in the + * future. Required on create. + * + * @return the startDate value. + */ + public OffsetDateTime startDate() { + return this.innerProperties() == null ? null : this.innerProperties().startDate(); + } + + /** + * Set the startDate property: The DateTime when the review is scheduled to be start. This could be a date in the + * future. Required on create. + * + * @param startDate the startDate value to set. + * @return the AccessReviewDefaultSettingsInner object itself. + */ + public AccessReviewDefaultSettingsInner withStartDate(OffsetDateTime startDate) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewScheduleSettings(); + } + this.innerProperties().withStartDate(startDate); + return this; + } + + /** + * Get the endDate property: The DateTime when the review is scheduled to end. Required if type is endDate. + * + * @return the endDate value. + */ + public OffsetDateTime endDate() { + return this.innerProperties() == null ? null : this.innerProperties().endDate(); + } + + /** + * Set the endDate property: The DateTime when the review is scheduled to end. Required if type is endDate. + * + * @param endDate the endDate value to set. + * @return the AccessReviewDefaultSettingsInner object itself. + */ + public AccessReviewDefaultSettingsInner withEndDate(OffsetDateTime endDate) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewScheduleSettings(); + } + this.innerProperties().withEndDate(endDate); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewHistoryDefinitionInner.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewHistoryDefinitionInner.java new file mode 100644 index 0000000000000..ba184e5e7a38c --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewHistoryDefinitionInner.java @@ -0,0 +1,361 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewActorIdentityType; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewHistoryDefinitionStatus; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewRecurrencePatternType; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewRecurrenceRangeType; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewResult; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Access Review History Definition. */ +@Fluent +public final class AccessReviewHistoryDefinitionInner extends ProxyResource { + /* + * Access Review History Definition properties. + */ + @JsonProperty(value = "properties") + private AccessReviewHistoryDefinitionProperties innerProperties; + + /** + * Get the innerProperties property: Access Review History Definition properties. + * + * @return the innerProperties value. + */ + private AccessReviewHistoryDefinitionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the displayName property: The display name for the history definition. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Set the displayName property: The display name for the history definition. + * + * @param displayName the displayName value to set. + * @return the AccessReviewHistoryDefinitionInner object itself. + */ + public AccessReviewHistoryDefinitionInner withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewHistoryDefinitionProperties(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } + + /** + * Get the reviewHistoryPeriodStartDateTime property: 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. + * + * @return the reviewHistoryPeriodStartDateTime value. + */ + public OffsetDateTime reviewHistoryPeriodStartDateTime() { + return this.innerProperties() == null ? null : this.innerProperties().reviewHistoryPeriodStartDateTime(); + } + + /** + * Get the reviewHistoryPeriodEndDateTime property: 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. + * + * @return the reviewHistoryPeriodEndDateTime value. + */ + public OffsetDateTime reviewHistoryPeriodEndDateTime() { + return this.innerProperties() == null ? null : this.innerProperties().reviewHistoryPeriodEndDateTime(); + } + + /** + * Get the decisions property: 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. + * + * @return the decisions value. + */ + public List decisions() { + return this.innerProperties() == null ? null : this.innerProperties().decisions(); + } + + /** + * Set the decisions property: 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. + * + * @param decisions the decisions value to set. + * @return the AccessReviewHistoryDefinitionInner object itself. + */ + public AccessReviewHistoryDefinitionInner withDecisions(List decisions) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewHistoryDefinitionProperties(); + } + this.innerProperties().withDecisions(decisions); + return this; + } + + /** + * Get the status property: This read-only field specifies the of the requested review history data. This is either + * requested, in-progress, done or error. + * + * @return the status value. + */ + public AccessReviewHistoryDefinitionStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the createdDateTime property: Date time when history definition was created. + * + * @return the createdDateTime value. + */ + public OffsetDateTime createdDateTime() { + return this.innerProperties() == null ? null : this.innerProperties().createdDateTime(); + } + + /** + * Get the scopes property: A collection of scopes used when selecting review history data. + * + * @return the scopes value. + */ + public List scopes() { + return this.innerProperties() == null ? null : this.innerProperties().scopes(); + } + + /** + * Set the scopes property: A collection of scopes used when selecting review history data. + * + * @param scopes the scopes value to set. + * @return the AccessReviewHistoryDefinitionInner object itself. + */ + public AccessReviewHistoryDefinitionInner withScopes(List scopes) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewHistoryDefinitionProperties(); + } + this.innerProperties().withScopes(scopes); + return this; + } + + /** + * Get the instances property: Set of access review history instances for this history definition. + * + * @return the instances value. + */ + public List instances() { + return this.innerProperties() == null ? null : this.innerProperties().instances(); + } + + /** + * Set the instances property: Set of access review history instances for this history definition. + * + * @param instances the instances value to set. + * @return the AccessReviewHistoryDefinitionInner object itself. + */ + public AccessReviewHistoryDefinitionInner withInstances(List instances) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewHistoryDefinitionProperties(); + } + this.innerProperties().withInstances(instances); + return this; + } + + /** + * Get the principalId property: The identity id. + * + * @return the principalId value. + */ + public String principalId() { + return this.innerProperties() == null ? null : this.innerProperties().principalId(); + } + + /** + * Get the principalType property: The identity type : user/servicePrincipal. + * + * @return the principalType value. + */ + public AccessReviewActorIdentityType principalType() { + return this.innerProperties() == null ? null : this.innerProperties().principalType(); + } + + /** + * Get the principalName property: The identity display name. + * + * @return the principalName value. + */ + public String principalName() { + return this.innerProperties() == null ? null : this.innerProperties().principalName(); + } + + /** + * Get the userPrincipalName property: The user principal name(if valid). + * + * @return the userPrincipalName value. + */ + public String userPrincipalName() { + return this.innerProperties() == null ? null : this.innerProperties().userPrincipalName(); + } + + /** + * Get the type property: The recurrence type : weekly, monthly, etc. + * + * @return the type value. + */ + public AccessReviewRecurrencePatternType typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Set the type property: The recurrence type : weekly, monthly, etc. + * + * @param type the type value to set. + * @return the AccessReviewHistoryDefinitionInner object itself. + */ + public AccessReviewHistoryDefinitionInner withTypePropertiesType(AccessReviewRecurrencePatternType type) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewHistoryDefinitionProperties(); + } + this.innerProperties().withType(type); + return this; + } + + /** + * Get the interval property: The interval for recurrence. For a quarterly review, the interval is 3 for type : + * absoluteMonthly. + * + * @return the interval value. + */ + public Integer interval() { + return this.innerProperties() == null ? null : this.innerProperties().interval(); + } + + /** + * Set the interval property: The interval for recurrence. For a quarterly review, the interval is 3 for type : + * absoluteMonthly. + * + * @param interval the interval value to set. + * @return the AccessReviewHistoryDefinitionInner object itself. + */ + public AccessReviewHistoryDefinitionInner withInterval(Integer interval) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewHistoryDefinitionProperties(); + } + this.innerProperties().withInterval(interval); + return this; + } + + /** + * Get the typeRangeType property: The recurrence range type. The possible values are: endDate, noEnd, numbered. + * + * @return the typeRangeType value. + */ + public AccessReviewRecurrenceRangeType typeRangeType() { + return this.innerProperties() == null ? null : this.innerProperties().typeRangeType(); + } + + /** + * Set the typeRangeType property: The recurrence range type. The possible values are: endDate, noEnd, numbered. + * + * @param typeRangeType the typeRangeType value to set. + * @return the AccessReviewHistoryDefinitionInner object itself. + */ + public AccessReviewHistoryDefinitionInner withTypeRangeType(AccessReviewRecurrenceRangeType typeRangeType) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewHistoryDefinitionProperties(); + } + this.innerProperties().withTypeRangeType(typeRangeType); + return this; + } + + /** + * Get the numberOfOccurrences property: The number of times to repeat the access review. Required and must be + * positive if type is numbered. + * + * @return the numberOfOccurrences value. + */ + public Integer numberOfOccurrences() { + return this.innerProperties() == null ? null : this.innerProperties().numberOfOccurrences(); + } + + /** + * Set the numberOfOccurrences property: The number of times to repeat the access review. Required and must be + * positive if type is numbered. + * + * @param numberOfOccurrences the numberOfOccurrences value to set. + * @return the AccessReviewHistoryDefinitionInner object itself. + */ + public AccessReviewHistoryDefinitionInner withNumberOfOccurrences(Integer numberOfOccurrences) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewHistoryDefinitionProperties(); + } + this.innerProperties().withNumberOfOccurrences(numberOfOccurrences); + return this; + } + + /** + * Get the startDate property: The DateTime when the review is scheduled to be start. This could be a date in the + * future. Required on create. + * + * @return the startDate value. + */ + public OffsetDateTime startDate() { + return this.innerProperties() == null ? null : this.innerProperties().startDate(); + } + + /** + * Set the startDate property: The DateTime when the review is scheduled to be start. This could be a date in the + * future. Required on create. + * + * @param startDate the startDate value to set. + * @return the AccessReviewHistoryDefinitionInner object itself. + */ + public AccessReviewHistoryDefinitionInner withStartDate(OffsetDateTime startDate) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewHistoryDefinitionProperties(); + } + this.innerProperties().withStartDate(startDate); + return this; + } + + /** + * Get the endDate property: The DateTime when the review is scheduled to end. Required if type is endDate. + * + * @return the endDate value. + */ + public OffsetDateTime endDate() { + return this.innerProperties() == null ? null : this.innerProperties().endDate(); + } + + /** + * Set the endDate property: The DateTime when the review is scheduled to end. Required if type is endDate. + * + * @param endDate the endDate value to set. + * @return the AccessReviewHistoryDefinitionInner object itself. + */ + public AccessReviewHistoryDefinitionInner withEndDate(OffsetDateTime endDate) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewHistoryDefinitionProperties(); + } + this.innerProperties().withEndDate(endDate); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewHistoryDefinitionProperties.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewHistoryDefinitionProperties.java new file mode 100644 index 0000000000000..f850a459a04d7 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewHistoryDefinitionProperties.java @@ -0,0 +1,425 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewActorIdentityType; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewHistoryDefinitionStatus; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewRecurrencePatternType; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewRecurrenceRangeType; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewResult; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Access Review History Instances. */ +@Fluent +public final class AccessReviewHistoryDefinitionProperties { + /* + * The display name for the history definition. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * 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. + */ + @JsonProperty(value = "reviewHistoryPeriodStartDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime reviewHistoryPeriodStartDateTime; + + /* + * 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. + */ + @JsonProperty(value = "reviewHistoryPeriodEndDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime reviewHistoryPeriodEndDateTime; + + /* + * 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. + */ + @JsonProperty(value = "decisions") + private List decisions; + + /* + * This read-only field specifies the of the requested review history data. This is either requested, in-progress, + * done or error. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private AccessReviewHistoryDefinitionStatus status; + + /* + * Date time when history definition was created + */ + @JsonProperty(value = "createdDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDateTime; + + /* + * The user or other identity who created this history definition. + */ + @JsonProperty(value = "createdBy", access = JsonProperty.Access.WRITE_ONLY) + private AccessReviewActorIdentity innerCreatedBy; + + /* + * A collection of scopes used when selecting review history data + */ + @JsonProperty(value = "scopes") + private List scopes; + + /* + * Recurrence settings for recurring history reports, skip for one-time reports. + */ + @JsonProperty(value = "settings") + private AccessReviewHistoryScheduleSettings innerSettings; + + /* + * Set of access review history instances for this history definition. + */ + @JsonProperty(value = "instances") + private List instances; + + /** + * Get the displayName property: The display name for the history definition. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name for the history definition. + * + * @param displayName the displayName value to set. + * @return the AccessReviewHistoryDefinitionProperties object itself. + */ + public AccessReviewHistoryDefinitionProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the reviewHistoryPeriodStartDateTime property: 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. + * + * @return the reviewHistoryPeriodStartDateTime value. + */ + public OffsetDateTime reviewHistoryPeriodStartDateTime() { + return this.reviewHistoryPeriodStartDateTime; + } + + /** + * Get the reviewHistoryPeriodEndDateTime property: 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. + * + * @return the reviewHistoryPeriodEndDateTime value. + */ + public OffsetDateTime reviewHistoryPeriodEndDateTime() { + return this.reviewHistoryPeriodEndDateTime; + } + + /** + * Get the decisions property: 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. + * + * @return the decisions value. + */ + public List decisions() { + return this.decisions; + } + + /** + * Set the decisions property: 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. + * + * @param decisions the decisions value to set. + * @return the AccessReviewHistoryDefinitionProperties object itself. + */ + public AccessReviewHistoryDefinitionProperties withDecisions(List decisions) { + this.decisions = decisions; + return this; + } + + /** + * Get the status property: This read-only field specifies the of the requested review history data. This is either + * requested, in-progress, done or error. + * + * @return the status value. + */ + public AccessReviewHistoryDefinitionStatus status() { + return this.status; + } + + /** + * Get the createdDateTime property: Date time when history definition was created. + * + * @return the createdDateTime value. + */ + public OffsetDateTime createdDateTime() { + return this.createdDateTime; + } + + /** + * Get the innerCreatedBy property: The user or other identity who created this history definition. + * + * @return the innerCreatedBy value. + */ + private AccessReviewActorIdentity innerCreatedBy() { + return this.innerCreatedBy; + } + + /** + * Get the scopes property: A collection of scopes used when selecting review history data. + * + * @return the scopes value. + */ + public List scopes() { + return this.scopes; + } + + /** + * Set the scopes property: A collection of scopes used when selecting review history data. + * + * @param scopes the scopes value to set. + * @return the AccessReviewHistoryDefinitionProperties object itself. + */ + public AccessReviewHistoryDefinitionProperties withScopes(List scopes) { + this.scopes = scopes; + return this; + } + + /** + * Get the innerSettings property: Recurrence settings for recurring history reports, skip for one-time reports. + * + * @return the innerSettings value. + */ + private AccessReviewHistoryScheduleSettings innerSettings() { + return this.innerSettings; + } + + /** + * Get the instances property: Set of access review history instances for this history definition. + * + * @return the instances value. + */ + public List instances() { + return this.instances; + } + + /** + * Set the instances property: Set of access review history instances for this history definition. + * + * @param instances the instances value to set. + * @return the AccessReviewHistoryDefinitionProperties object itself. + */ + public AccessReviewHistoryDefinitionProperties withInstances(List instances) { + this.instances = instances; + return this; + } + + /** + * Get the principalId property: The identity id. + * + * @return the principalId value. + */ + public String principalId() { + return this.innerCreatedBy() == null ? null : this.innerCreatedBy().principalId(); + } + + /** + * Get the principalType property: The identity type : user/servicePrincipal. + * + * @return the principalType value. + */ + public AccessReviewActorIdentityType principalType() { + return this.innerCreatedBy() == null ? null : this.innerCreatedBy().principalType(); + } + + /** + * Get the principalName property: The identity display name. + * + * @return the principalName value. + */ + public String principalName() { + return this.innerCreatedBy() == null ? null : this.innerCreatedBy().principalName(); + } + + /** + * Get the userPrincipalName property: The user principal name(if valid). + * + * @return the userPrincipalName value. + */ + public String userPrincipalName() { + return this.innerCreatedBy() == null ? null : this.innerCreatedBy().userPrincipalName(); + } + + /** + * Get the type property: The recurrence type : weekly, monthly, etc. + * + * @return the type value. + */ + public AccessReviewRecurrencePatternType type() { + return this.innerSettings() == null ? null : this.innerSettings().type(); + } + + /** + * Set the type property: The recurrence type : weekly, monthly, etc. + * + * @param type the type value to set. + * @return the AccessReviewHistoryDefinitionProperties object itself. + */ + public AccessReviewHistoryDefinitionProperties withType(AccessReviewRecurrencePatternType type) { + if (this.innerSettings() == null) { + this.innerSettings = new AccessReviewHistoryScheduleSettings(); + } + this.innerSettings().withType(type); + return this; + } + + /** + * Get the interval property: The interval for recurrence. For a quarterly review, the interval is 3 for type : + * absoluteMonthly. + * + * @return the interval value. + */ + public Integer interval() { + return this.innerSettings() == null ? null : this.innerSettings().interval(); + } + + /** + * Set the interval property: The interval for recurrence. For a quarterly review, the interval is 3 for type : + * absoluteMonthly. + * + * @param interval the interval value to set. + * @return the AccessReviewHistoryDefinitionProperties object itself. + */ + public AccessReviewHistoryDefinitionProperties withInterval(Integer interval) { + if (this.innerSettings() == null) { + this.innerSettings = new AccessReviewHistoryScheduleSettings(); + } + this.innerSettings().withInterval(interval); + return this; + } + + /** + * Get the typeRangeType property: The recurrence range type. The possible values are: endDate, noEnd, numbered. + * + * @return the typeRangeType value. + */ + public AccessReviewRecurrenceRangeType typeRangeType() { + return this.innerSettings() == null ? null : this.innerSettings().typeRangeType(); + } + + /** + * Set the typeRangeType property: The recurrence range type. The possible values are: endDate, noEnd, numbered. + * + * @param typeRangeType the typeRangeType value to set. + * @return the AccessReviewHistoryDefinitionProperties object itself. + */ + public AccessReviewHistoryDefinitionProperties withTypeRangeType(AccessReviewRecurrenceRangeType typeRangeType) { + if (this.innerSettings() == null) { + this.innerSettings = new AccessReviewHistoryScheduleSettings(); + } + this.innerSettings().withTypeRangeType(typeRangeType); + return this; + } + + /** + * Get the numberOfOccurrences property: The number of times to repeat the access review. Required and must be + * positive if type is numbered. + * + * @return the numberOfOccurrences value. + */ + public Integer numberOfOccurrences() { + return this.innerSettings() == null ? null : this.innerSettings().numberOfOccurrences(); + } + + /** + * Set the numberOfOccurrences property: The number of times to repeat the access review. Required and must be + * positive if type is numbered. + * + * @param numberOfOccurrences the numberOfOccurrences value to set. + * @return the AccessReviewHistoryDefinitionProperties object itself. + */ + public AccessReviewHistoryDefinitionProperties withNumberOfOccurrences(Integer numberOfOccurrences) { + if (this.innerSettings() == null) { + this.innerSettings = new AccessReviewHistoryScheduleSettings(); + } + this.innerSettings().withNumberOfOccurrences(numberOfOccurrences); + return this; + } + + /** + * Get the startDate property: The DateTime when the review is scheduled to be start. This could be a date in the + * future. Required on create. + * + * @return the startDate value. + */ + public OffsetDateTime startDate() { + return this.innerSettings() == null ? null : this.innerSettings().startDate(); + } + + /** + * Set the startDate property: The DateTime when the review is scheduled to be start. This could be a date in the + * future. Required on create. + * + * @param startDate the startDate value to set. + * @return the AccessReviewHistoryDefinitionProperties object itself. + */ + public AccessReviewHistoryDefinitionProperties withStartDate(OffsetDateTime startDate) { + if (this.innerSettings() == null) { + this.innerSettings = new AccessReviewHistoryScheduleSettings(); + } + this.innerSettings().withStartDate(startDate); + return this; + } + + /** + * Get the endDate property: The DateTime when the review is scheduled to end. Required if type is endDate. + * + * @return the endDate value. + */ + public OffsetDateTime endDate() { + return this.innerSettings() == null ? null : this.innerSettings().endDate(); + } + + /** + * Set the endDate property: The DateTime when the review is scheduled to end. Required if type is endDate. + * + * @param endDate the endDate value to set. + * @return the AccessReviewHistoryDefinitionProperties object itself. + */ + public AccessReviewHistoryDefinitionProperties withEndDate(OffsetDateTime endDate) { + if (this.innerSettings() == null) { + this.innerSettings = new AccessReviewHistoryScheduleSettings(); + } + this.innerSettings().withEndDate(endDate); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerCreatedBy() != null) { + innerCreatedBy().validate(); + } + if (scopes() != null) { + scopes().forEach(e -> e.validate()); + } + if (innerSettings() != null) { + innerSettings().validate(); + } + if (instances() != null) { + instances().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewHistoryInstanceInner.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewHistoryInstanceInner.java new file mode 100644 index 0000000000000..9d472fe664617 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewHistoryInstanceInner.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewHistoryDefinitionStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Access Review History Definition Instance. */ +@Fluent +public final class AccessReviewHistoryInstanceInner extends ProxyResource { + /* + * Access Review History Definition Instance properties. + */ + @JsonProperty(value = "properties") + private AccessReviewHistoryInstanceProperties innerProperties; + + /** + * Get the innerProperties property: Access Review History Definition Instance properties. + * + * @return the innerProperties value. + */ + private AccessReviewHistoryInstanceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the reviewHistoryPeriodStartDateTime property: 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. + * + * @return the reviewHistoryPeriodStartDateTime value. + */ + public OffsetDateTime reviewHistoryPeriodStartDateTime() { + return this.innerProperties() == null ? null : this.innerProperties().reviewHistoryPeriodStartDateTime(); + } + + /** + * Set the reviewHistoryPeriodStartDateTime property: 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. + * + * @param reviewHistoryPeriodStartDateTime the reviewHistoryPeriodStartDateTime value to set. + * @return the AccessReviewHistoryInstanceInner object itself. + */ + public AccessReviewHistoryInstanceInner withReviewHistoryPeriodStartDateTime( + OffsetDateTime reviewHistoryPeriodStartDateTime) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewHistoryInstanceProperties(); + } + this.innerProperties().withReviewHistoryPeriodStartDateTime(reviewHistoryPeriodStartDateTime); + return this; + } + + /** + * Get the reviewHistoryPeriodEndDateTime property: 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. + * + * @return the reviewHistoryPeriodEndDateTime value. + */ + public OffsetDateTime reviewHistoryPeriodEndDateTime() { + return this.innerProperties() == null ? null : this.innerProperties().reviewHistoryPeriodEndDateTime(); + } + + /** + * Set the reviewHistoryPeriodEndDateTime property: 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. + * + * @param reviewHistoryPeriodEndDateTime the reviewHistoryPeriodEndDateTime value to set. + * @return the AccessReviewHistoryInstanceInner object itself. + */ + public AccessReviewHistoryInstanceInner withReviewHistoryPeriodEndDateTime( + OffsetDateTime reviewHistoryPeriodEndDateTime) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewHistoryInstanceProperties(); + } + this.innerProperties().withReviewHistoryPeriodEndDateTime(reviewHistoryPeriodEndDateTime); + return this; + } + + /** + * Get the displayName property: The display name for the parent history definition. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Set the displayName property: The display name for the parent history definition. + * + * @param displayName the displayName value to set. + * @return the AccessReviewHistoryInstanceInner object itself. + */ + public AccessReviewHistoryInstanceInner withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewHistoryInstanceProperties(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } + + /** + * Get the status property: 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. + * + * @return the status value. + */ + public AccessReviewHistoryDefinitionStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the runDateTime property: Date time when the history data report is scheduled to be generated. + * + * @return the runDateTime value. + */ + public OffsetDateTime runDateTime() { + return this.innerProperties() == null ? null : this.innerProperties().runDateTime(); + } + + /** + * Set the runDateTime property: Date time when the history data report is scheduled to be generated. + * + * @param runDateTime the runDateTime value to set. + * @return the AccessReviewHistoryInstanceInner object itself. + */ + public AccessReviewHistoryInstanceInner withRunDateTime(OffsetDateTime runDateTime) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewHistoryInstanceProperties(); + } + this.innerProperties().withRunDateTime(runDateTime); + return this; + } + + /** + * Get the fulfilledDateTime property: Date time when the history data report is scheduled to be generated. + * + * @return the fulfilledDateTime value. + */ + public OffsetDateTime fulfilledDateTime() { + return this.innerProperties() == null ? null : this.innerProperties().fulfilledDateTime(); + } + + /** + * Set the fulfilledDateTime property: Date time when the history data report is scheduled to be generated. + * + * @param fulfilledDateTime the fulfilledDateTime value to set. + * @return the AccessReviewHistoryInstanceInner object itself. + */ + public AccessReviewHistoryInstanceInner withFulfilledDateTime(OffsetDateTime fulfilledDateTime) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewHistoryInstanceProperties(); + } + this.innerProperties().withFulfilledDateTime(fulfilledDateTime); + return this; + } + + /** + * Get the downloadUri property: 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. + * + * @return the downloadUri value. + */ + public String downloadUri() { + return this.innerProperties() == null ? null : this.innerProperties().downloadUri(); + } + + /** + * Get the expiration property: Date time when history data report expires and the associated data is deleted. + * + * @return the expiration value. + */ + public OffsetDateTime expiration() { + return this.innerProperties() == null ? null : this.innerProperties().expiration(); + } + + /** + * Set the expiration property: Date time when history data report expires and the associated data is deleted. + * + * @param expiration the expiration value to set. + * @return the AccessReviewHistoryInstanceInner object itself. + */ + public AccessReviewHistoryInstanceInner withExpiration(OffsetDateTime expiration) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewHistoryInstanceProperties(); + } + this.innerProperties().withExpiration(expiration); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewHistoryInstanceProperties.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewHistoryInstanceProperties.java new file mode 100644 index 0000000000000..fa6e15575afe8 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewHistoryInstanceProperties.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewHistoryDefinitionStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Access Review History Definition Instance properties. */ +@Fluent +public final class AccessReviewHistoryInstanceProperties { + /* + * 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. + */ + @JsonProperty(value = "reviewHistoryPeriodStartDateTime") + private OffsetDateTime reviewHistoryPeriodStartDateTime; + + /* + * 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. + */ + @JsonProperty(value = "reviewHistoryPeriodEndDateTime") + private OffsetDateTime reviewHistoryPeriodEndDateTime; + + /* + * The display name for the parent history definition. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * 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 + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private AccessReviewHistoryDefinitionStatus status; + + /* + * Date time when the history data report is scheduled to be generated. + */ + @JsonProperty(value = "runDateTime") + private OffsetDateTime runDateTime; + + /* + * Date time when the history data report is scheduled to be generated. + */ + @JsonProperty(value = "fulfilledDateTime") + private OffsetDateTime fulfilledDateTime; + + /* + * 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. + */ + @JsonProperty(value = "downloadUri", access = JsonProperty.Access.WRITE_ONLY) + private String downloadUri; + + /* + * Date time when history data report expires and the associated data is deleted. + */ + @JsonProperty(value = "expiration") + private OffsetDateTime expiration; + + /** + * Get the reviewHistoryPeriodStartDateTime property: 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. + * + * @return the reviewHistoryPeriodStartDateTime value. + */ + public OffsetDateTime reviewHistoryPeriodStartDateTime() { + return this.reviewHistoryPeriodStartDateTime; + } + + /** + * Set the reviewHistoryPeriodStartDateTime property: 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. + * + * @param reviewHistoryPeriodStartDateTime the reviewHistoryPeriodStartDateTime value to set. + * @return the AccessReviewHistoryInstanceProperties object itself. + */ + public AccessReviewHistoryInstanceProperties withReviewHistoryPeriodStartDateTime( + OffsetDateTime reviewHistoryPeriodStartDateTime) { + this.reviewHistoryPeriodStartDateTime = reviewHistoryPeriodStartDateTime; + return this; + } + + /** + * Get the reviewHistoryPeriodEndDateTime property: 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. + * + * @return the reviewHistoryPeriodEndDateTime value. + */ + public OffsetDateTime reviewHistoryPeriodEndDateTime() { + return this.reviewHistoryPeriodEndDateTime; + } + + /** + * Set the reviewHistoryPeriodEndDateTime property: 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. + * + * @param reviewHistoryPeriodEndDateTime the reviewHistoryPeriodEndDateTime value to set. + * @return the AccessReviewHistoryInstanceProperties object itself. + */ + public AccessReviewHistoryInstanceProperties withReviewHistoryPeriodEndDateTime( + OffsetDateTime reviewHistoryPeriodEndDateTime) { + this.reviewHistoryPeriodEndDateTime = reviewHistoryPeriodEndDateTime; + return this; + } + + /** + * Get the displayName property: The display name for the parent history definition. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name for the parent history definition. + * + * @param displayName the displayName value to set. + * @return the AccessReviewHistoryInstanceProperties object itself. + */ + public AccessReviewHistoryInstanceProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the status property: 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. + * + * @return the status value. + */ + public AccessReviewHistoryDefinitionStatus status() { + return this.status; + } + + /** + * Get the runDateTime property: Date time when the history data report is scheduled to be generated. + * + * @return the runDateTime value. + */ + public OffsetDateTime runDateTime() { + return this.runDateTime; + } + + /** + * Set the runDateTime property: Date time when the history data report is scheduled to be generated. + * + * @param runDateTime the runDateTime value to set. + * @return the AccessReviewHistoryInstanceProperties object itself. + */ + public AccessReviewHistoryInstanceProperties withRunDateTime(OffsetDateTime runDateTime) { + this.runDateTime = runDateTime; + return this; + } + + /** + * Get the fulfilledDateTime property: Date time when the history data report is scheduled to be generated. + * + * @return the fulfilledDateTime value. + */ + public OffsetDateTime fulfilledDateTime() { + return this.fulfilledDateTime; + } + + /** + * Set the fulfilledDateTime property: Date time when the history data report is scheduled to be generated. + * + * @param fulfilledDateTime the fulfilledDateTime value to set. + * @return the AccessReviewHistoryInstanceProperties object itself. + */ + public AccessReviewHistoryInstanceProperties withFulfilledDateTime(OffsetDateTime fulfilledDateTime) { + this.fulfilledDateTime = fulfilledDateTime; + return this; + } + + /** + * Get the downloadUri property: 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. + * + * @return the downloadUri value. + */ + public String downloadUri() { + return this.downloadUri; + } + + /** + * Get the expiration property: Date time when history data report expires and the associated data is deleted. + * + * @return the expiration value. + */ + public OffsetDateTime expiration() { + return this.expiration; + } + + /** + * Set the expiration property: Date time when history data report expires and the associated data is deleted. + * + * @param expiration the expiration value to set. + * @return the AccessReviewHistoryInstanceProperties object itself. + */ + public AccessReviewHistoryInstanceProperties withExpiration(OffsetDateTime expiration) { + this.expiration = expiration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewHistoryScheduleSettings.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewHistoryScheduleSettings.java new file mode 100644 index 0000000000000..94e38abb6f7e2 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewHistoryScheduleSettings.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewRecurrencePatternType; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewRecurrenceRangeType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Recurrence settings of an Access Review History Definition. */ +@Fluent +public final class AccessReviewHistoryScheduleSettings { + /* + * Access Review History Definition recurrence settings. + */ + @JsonProperty(value = "pattern") + private AccessReviewRecurrencePattern innerPattern; + + /* + * Access Review History Definition recurrence settings. + */ + @JsonProperty(value = "range") + private AccessReviewRecurrenceRange innerRange; + + /** + * Get the innerPattern property: Access Review History Definition recurrence settings. + * + * @return the innerPattern value. + */ + private AccessReviewRecurrencePattern innerPattern() { + return this.innerPattern; + } + + /** + * Get the innerRange property: Access Review History Definition recurrence settings. + * + * @return the innerRange value. + */ + private AccessReviewRecurrenceRange innerRange() { + return this.innerRange; + } + + /** + * Get the type property: The recurrence type : weekly, monthly, etc. + * + * @return the type value. + */ + public AccessReviewRecurrencePatternType type() { + return this.innerPattern() == null ? null : this.innerPattern().type(); + } + + /** + * Set the type property: The recurrence type : weekly, monthly, etc. + * + * @param type the type value to set. + * @return the AccessReviewHistoryScheduleSettings object itself. + */ + public AccessReviewHistoryScheduleSettings withType(AccessReviewRecurrencePatternType type) { + if (this.innerPattern() == null) { + this.innerPattern = new AccessReviewRecurrencePattern(); + } + this.innerPattern().withType(type); + return this; + } + + /** + * Get the interval property: The interval for recurrence. For a quarterly review, the interval is 3 for type : + * absoluteMonthly. + * + * @return the interval value. + */ + public Integer interval() { + return this.innerPattern() == null ? null : this.innerPattern().interval(); + } + + /** + * Set the interval property: The interval for recurrence. For a quarterly review, the interval is 3 for type : + * absoluteMonthly. + * + * @param interval the interval value to set. + * @return the AccessReviewHistoryScheduleSettings object itself. + */ + public AccessReviewHistoryScheduleSettings withInterval(Integer interval) { + if (this.innerPattern() == null) { + this.innerPattern = new AccessReviewRecurrencePattern(); + } + this.innerPattern().withInterval(interval); + return this; + } + + /** + * Get the type property: The recurrence range type. The possible values are: endDate, noEnd, numbered. + * + * @return the type value. + */ + public AccessReviewRecurrenceRangeType typeRangeType() { + return this.innerRange() == null ? null : this.innerRange().type(); + } + + /** + * Set the type property: The recurrence range type. The possible values are: endDate, noEnd, numbered. + * + * @param type the type value to set. + * @return the AccessReviewHistoryScheduleSettings object itself. + */ + public AccessReviewHistoryScheduleSettings withTypeRangeType(AccessReviewRecurrenceRangeType type) { + if (this.innerRange() == null) { + this.innerRange = new AccessReviewRecurrenceRange(); + } + this.innerRange().withType(type); + return this; + } + + /** + * Get the numberOfOccurrences property: The number of times to repeat the access review. Required and must be + * positive if type is numbered. + * + * @return the numberOfOccurrences value. + */ + public Integer numberOfOccurrences() { + return this.innerRange() == null ? null : this.innerRange().numberOfOccurrences(); + } + + /** + * Set the numberOfOccurrences property: The number of times to repeat the access review. Required and must be + * positive if type is numbered. + * + * @param numberOfOccurrences the numberOfOccurrences value to set. + * @return the AccessReviewHistoryScheduleSettings object itself. + */ + public AccessReviewHistoryScheduleSettings withNumberOfOccurrences(Integer numberOfOccurrences) { + if (this.innerRange() == null) { + this.innerRange = new AccessReviewRecurrenceRange(); + } + this.innerRange().withNumberOfOccurrences(numberOfOccurrences); + return this; + } + + /** + * Get the startDate property: The DateTime when the review is scheduled to be start. This could be a date in the + * future. Required on create. + * + * @return the startDate value. + */ + public OffsetDateTime startDate() { + return this.innerRange() == null ? null : this.innerRange().startDate(); + } + + /** + * Set the startDate property: The DateTime when the review is scheduled to be start. This could be a date in the + * future. Required on create. + * + * @param startDate the startDate value to set. + * @return the AccessReviewHistoryScheduleSettings object itself. + */ + public AccessReviewHistoryScheduleSettings withStartDate(OffsetDateTime startDate) { + if (this.innerRange() == null) { + this.innerRange = new AccessReviewRecurrenceRange(); + } + this.innerRange().withStartDate(startDate); + return this; + } + + /** + * Get the endDate property: The DateTime when the review is scheduled to end. Required if type is endDate. + * + * @return the endDate value. + */ + public OffsetDateTime endDate() { + return this.innerRange() == null ? null : this.innerRange().endDate(); + } + + /** + * Set the endDate property: The DateTime when the review is scheduled to end. Required if type is endDate. + * + * @param endDate the endDate value to set. + * @return the AccessReviewHistoryScheduleSettings object itself. + */ + public AccessReviewHistoryScheduleSettings withEndDate(OffsetDateTime endDate) { + if (this.innerRange() == null) { + this.innerRange = new AccessReviewRecurrenceRange(); + } + this.innerRange().withEndDate(endDate); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerPattern() != null) { + innerPattern().validate(); + } + if (innerRange() != null) { + innerRange().validate(); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewInstanceInner.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewInstanceInner.java new file mode 100644 index 0000000000000..e10bc15c5eec6 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewInstanceInner.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewInstanceReviewersType; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewInstanceStatus; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewReviewer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Access Review Instance. */ +@Fluent +public final class AccessReviewInstanceInner extends ProxyResource { + /* + * Access Review properties. + */ + @JsonProperty(value = "properties") + private AccessReviewInstanceProperties innerProperties; + + /** + * Get the innerProperties property: Access Review properties. + * + * @return the innerProperties value. + */ + private AccessReviewInstanceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the status property: This read-only field specifies the status of an access review instance. + * + * @return the status value. + */ + public AccessReviewInstanceStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the startDateTime property: The DateTime when the review instance is scheduled to be start. + * + * @return the startDateTime value. + */ + public OffsetDateTime startDateTime() { + return this.innerProperties() == null ? null : this.innerProperties().startDateTime(); + } + + /** + * Set the startDateTime property: The DateTime when the review instance is scheduled to be start. + * + * @param startDateTime the startDateTime value to set. + * @return the AccessReviewInstanceInner object itself. + */ + public AccessReviewInstanceInner withStartDateTime(OffsetDateTime startDateTime) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewInstanceProperties(); + } + this.innerProperties().withStartDateTime(startDateTime); + return this; + } + + /** + * Get the endDateTime property: The DateTime when the review instance is scheduled to end. + * + * @return the endDateTime value. + */ + public OffsetDateTime endDateTime() { + return this.innerProperties() == null ? null : this.innerProperties().endDateTime(); + } + + /** + * Set the endDateTime property: The DateTime when the review instance is scheduled to end. + * + * @param endDateTime the endDateTime value to set. + * @return the AccessReviewInstanceInner object itself. + */ + public AccessReviewInstanceInner withEndDateTime(OffsetDateTime endDateTime) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewInstanceProperties(); + } + this.innerProperties().withEndDateTime(endDateTime); + return this; + } + + /** + * Get the reviewers property: This is the collection of reviewers. + * + * @return the reviewers value. + */ + public List reviewers() { + return this.innerProperties() == null ? null : this.innerProperties().reviewers(); + } + + /** + * Set the reviewers property: This is the collection of reviewers. + * + * @param reviewers the reviewers value to set. + * @return the AccessReviewInstanceInner object itself. + */ + public AccessReviewInstanceInner withReviewers(List reviewers) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewInstanceProperties(); + } + this.innerProperties().withReviewers(reviewers); + return this; + } + + /** + * Get the backupReviewers property: This is the collection of backup reviewers. + * + * @return the backupReviewers value. + */ + public List backupReviewers() { + return this.innerProperties() == null ? null : this.innerProperties().backupReviewers(); + } + + /** + * Set the backupReviewers property: This is the collection of backup reviewers. + * + * @param backupReviewers the backupReviewers value to set. + * @return the AccessReviewInstanceInner object itself. + */ + public AccessReviewInstanceInner withBackupReviewers(List backupReviewers) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewInstanceProperties(); + } + this.innerProperties().withBackupReviewers(backupReviewers); + return this; + } + + /** + * Get the reviewersType property: 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. + * + * @return the reviewersType value. + */ + public AccessReviewInstanceReviewersType reviewersType() { + return this.innerProperties() == null ? null : this.innerProperties().reviewersType(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewInstanceProperties.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewInstanceProperties.java new file mode 100644 index 0000000000000..dcea4f678bdc0 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewInstanceProperties.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewInstanceReviewersType; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewInstanceStatus; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewReviewer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Access Review Instance properties. */ +@Fluent +public final class AccessReviewInstanceProperties { + /* + * This read-only field specifies the status of an access review instance. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private AccessReviewInstanceStatus status; + + /* + * The DateTime when the review instance is scheduled to be start. + */ + @JsonProperty(value = "startDateTime") + private OffsetDateTime startDateTime; + + /* + * The DateTime when the review instance is scheduled to end. + */ + @JsonProperty(value = "endDateTime") + private OffsetDateTime endDateTime; + + /* + * This is the collection of reviewers. + */ + @JsonProperty(value = "reviewers") + private List reviewers; + + /* + * This is the collection of backup reviewers. + */ + @JsonProperty(value = "backupReviewers") + private List backupReviewers; + + /* + * 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. + */ + @JsonProperty(value = "reviewersType", access = JsonProperty.Access.WRITE_ONLY) + private AccessReviewInstanceReviewersType reviewersType; + + /** + * Get the status property: This read-only field specifies the status of an access review instance. + * + * @return the status value. + */ + public AccessReviewInstanceStatus status() { + return this.status; + } + + /** + * Get the startDateTime property: The DateTime when the review instance is scheduled to be start. + * + * @return the startDateTime value. + */ + public OffsetDateTime startDateTime() { + return this.startDateTime; + } + + /** + * Set the startDateTime property: The DateTime when the review instance is scheduled to be start. + * + * @param startDateTime the startDateTime value to set. + * @return the AccessReviewInstanceProperties object itself. + */ + public AccessReviewInstanceProperties withStartDateTime(OffsetDateTime startDateTime) { + this.startDateTime = startDateTime; + return this; + } + + /** + * Get the endDateTime property: The DateTime when the review instance is scheduled to end. + * + * @return the endDateTime value. + */ + public OffsetDateTime endDateTime() { + return this.endDateTime; + } + + /** + * Set the endDateTime property: The DateTime when the review instance is scheduled to end. + * + * @param endDateTime the endDateTime value to set. + * @return the AccessReviewInstanceProperties object itself. + */ + public AccessReviewInstanceProperties withEndDateTime(OffsetDateTime endDateTime) { + this.endDateTime = endDateTime; + return this; + } + + /** + * Get the reviewers property: This is the collection of reviewers. + * + * @return the reviewers value. + */ + public List reviewers() { + return this.reviewers; + } + + /** + * Set the reviewers property: This is the collection of reviewers. + * + * @param reviewers the reviewers value to set. + * @return the AccessReviewInstanceProperties object itself. + */ + public AccessReviewInstanceProperties withReviewers(List reviewers) { + this.reviewers = reviewers; + return this; + } + + /** + * Get the backupReviewers property: This is the collection of backup reviewers. + * + * @return the backupReviewers value. + */ + public List backupReviewers() { + return this.backupReviewers; + } + + /** + * Set the backupReviewers property: This is the collection of backup reviewers. + * + * @param backupReviewers the backupReviewers value to set. + * @return the AccessReviewInstanceProperties object itself. + */ + public AccessReviewInstanceProperties withBackupReviewers(List backupReviewers) { + this.backupReviewers = backupReviewers; + return this; + } + + /** + * Get the reviewersType property: 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. + * + * @return the reviewersType value. + */ + public AccessReviewInstanceReviewersType reviewersType() { + return this.reviewersType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (reviewers() != null) { + reviewers().forEach(e -> e.validate()); + } + if (backupReviewers() != null) { + backupReviewers().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewRecurrencePattern.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewRecurrencePattern.java new file mode 100644 index 0000000000000..4f72994032bfb --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewRecurrencePattern.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewRecurrencePatternType; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Recurrence Pattern of an Access Review Schedule Definition. */ +@Fluent +public final class AccessReviewRecurrencePattern { + /* + * The recurrence type : weekly, monthly, etc. + */ + @JsonProperty(value = "type") + private AccessReviewRecurrencePatternType type; + + /* + * The interval for recurrence. For a quarterly review, the interval is 3 for type : absoluteMonthly. + */ + @JsonProperty(value = "interval") + private Integer interval; + + /** + * Get the type property: The recurrence type : weekly, monthly, etc. + * + * @return the type value. + */ + public AccessReviewRecurrencePatternType type() { + return this.type; + } + + /** + * Set the type property: The recurrence type : weekly, monthly, etc. + * + * @param type the type value to set. + * @return the AccessReviewRecurrencePattern object itself. + */ + public AccessReviewRecurrencePattern withType(AccessReviewRecurrencePatternType type) { + this.type = type; + return this; + } + + /** + * Get the interval property: The interval for recurrence. For a quarterly review, the interval is 3 for type : + * absoluteMonthly. + * + * @return the interval value. + */ + public Integer interval() { + return this.interval; + } + + /** + * Set the interval property: The interval for recurrence. For a quarterly review, the interval is 3 for type : + * absoluteMonthly. + * + * @param interval the interval value to set. + * @return the AccessReviewRecurrencePattern object itself. + */ + public AccessReviewRecurrencePattern withInterval(Integer interval) { + this.interval = interval; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewRecurrenceRange.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewRecurrenceRange.java new file mode 100644 index 0000000000000..019c42ba1941d --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewRecurrenceRange.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewRecurrenceRangeType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Recurrence Range of an Access Review Schedule Definition. */ +@Fluent +public final class AccessReviewRecurrenceRange { + /* + * The recurrence range type. The possible values are: endDate, noEnd, numbered. + */ + @JsonProperty(value = "type") + private AccessReviewRecurrenceRangeType type; + + /* + * The number of times to repeat the access review. Required and must be positive if type is numbered. + */ + @JsonProperty(value = "numberOfOccurrences") + private Integer numberOfOccurrences; + + /* + * The DateTime when the review is scheduled to be start. This could be a date in the future. Required on create. + */ + @JsonProperty(value = "startDate") + private OffsetDateTime startDate; + + /* + * The DateTime when the review is scheduled to end. Required if type is endDate + */ + @JsonProperty(value = "endDate") + private OffsetDateTime endDate; + + /** + * Get the type property: The recurrence range type. The possible values are: endDate, noEnd, numbered. + * + * @return the type value. + */ + public AccessReviewRecurrenceRangeType type() { + return this.type; + } + + /** + * Set the type property: The recurrence range type. The possible values are: endDate, noEnd, numbered. + * + * @param type the type value to set. + * @return the AccessReviewRecurrenceRange object itself. + */ + public AccessReviewRecurrenceRange withType(AccessReviewRecurrenceRangeType type) { + this.type = type; + return this; + } + + /** + * Get the numberOfOccurrences property: The number of times to repeat the access review. Required and must be + * positive if type is numbered. + * + * @return the numberOfOccurrences value. + */ + public Integer numberOfOccurrences() { + return this.numberOfOccurrences; + } + + /** + * Set the numberOfOccurrences property: The number of times to repeat the access review. Required and must be + * positive if type is numbered. + * + * @param numberOfOccurrences the numberOfOccurrences value to set. + * @return the AccessReviewRecurrenceRange object itself. + */ + public AccessReviewRecurrenceRange withNumberOfOccurrences(Integer numberOfOccurrences) { + this.numberOfOccurrences = numberOfOccurrences; + return this; + } + + /** + * Get the startDate property: The DateTime when the review is scheduled to be start. This could be a date in the + * future. Required on create. + * + * @return the startDate value. + */ + public OffsetDateTime startDate() { + return this.startDate; + } + + /** + * Set the startDate property: The DateTime when the review is scheduled to be start. This could be a date in the + * future. Required on create. + * + * @param startDate the startDate value to set. + * @return the AccessReviewRecurrenceRange object itself. + */ + public AccessReviewRecurrenceRange withStartDate(OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * Get the endDate property: The DateTime when the review is scheduled to end. Required if type is endDate. + * + * @return the endDate value. + */ + public OffsetDateTime endDate() { + return this.endDate; + } + + /** + * Set the endDate property: The DateTime when the review is scheduled to end. Required if type is endDate. + * + * @param endDate the endDate value to set. + * @return the AccessReviewRecurrenceRange object itself. + */ + public AccessReviewRecurrenceRange withEndDate(OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewRecurrenceSettings.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewRecurrenceSettings.java new file mode 100644 index 0000000000000..8b208080ae00b --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewRecurrenceSettings.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewRecurrencePatternType; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewRecurrenceRangeType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Recurrence Settings of an Access Review Schedule Definition. */ +@Fluent +public final class AccessReviewRecurrenceSettings { + /* + * Access Review schedule definition recurrence pattern. + */ + @JsonProperty(value = "pattern") + private AccessReviewRecurrencePattern innerPattern; + + /* + * Access Review schedule definition recurrence range. + */ + @JsonProperty(value = "range") + private AccessReviewRecurrenceRange innerRange; + + /** + * Get the innerPattern property: Access Review schedule definition recurrence pattern. + * + * @return the innerPattern value. + */ + private AccessReviewRecurrencePattern innerPattern() { + return this.innerPattern; + } + + /** + * Get the innerRange property: Access Review schedule definition recurrence range. + * + * @return the innerRange value. + */ + private AccessReviewRecurrenceRange innerRange() { + return this.innerRange; + } + + /** + * Get the type property: The recurrence type : weekly, monthly, etc. + * + * @return the type value. + */ + public AccessReviewRecurrencePatternType type() { + return this.innerPattern() == null ? null : this.innerPattern().type(); + } + + /** + * Set the type property: The recurrence type : weekly, monthly, etc. + * + * @param type the type value to set. + * @return the AccessReviewRecurrenceSettings object itself. + */ + public AccessReviewRecurrenceSettings withType(AccessReviewRecurrencePatternType type) { + if (this.innerPattern() == null) { + this.innerPattern = new AccessReviewRecurrencePattern(); + } + this.innerPattern().withType(type); + return this; + } + + /** + * Get the interval property: The interval for recurrence. For a quarterly review, the interval is 3 for type : + * absoluteMonthly. + * + * @return the interval value. + */ + public Integer interval() { + return this.innerPattern() == null ? null : this.innerPattern().interval(); + } + + /** + * Set the interval property: The interval for recurrence. For a quarterly review, the interval is 3 for type : + * absoluteMonthly. + * + * @param interval the interval value to set. + * @return the AccessReviewRecurrenceSettings object itself. + */ + public AccessReviewRecurrenceSettings withInterval(Integer interval) { + if (this.innerPattern() == null) { + this.innerPattern = new AccessReviewRecurrencePattern(); + } + this.innerPattern().withInterval(interval); + return this; + } + + /** + * Get the type property: The recurrence range type. The possible values are: endDate, noEnd, numbered. + * + * @return the type value. + */ + public AccessReviewRecurrenceRangeType typeRangeType() { + return this.innerRange() == null ? null : this.innerRange().type(); + } + + /** + * Set the type property: The recurrence range type. The possible values are: endDate, noEnd, numbered. + * + * @param type the type value to set. + * @return the AccessReviewRecurrenceSettings object itself. + */ + public AccessReviewRecurrenceSettings withTypeRangeType(AccessReviewRecurrenceRangeType type) { + if (this.innerRange() == null) { + this.innerRange = new AccessReviewRecurrenceRange(); + } + this.innerRange().withType(type); + return this; + } + + /** + * Get the numberOfOccurrences property: The number of times to repeat the access review. Required and must be + * positive if type is numbered. + * + * @return the numberOfOccurrences value. + */ + public Integer numberOfOccurrences() { + return this.innerRange() == null ? null : this.innerRange().numberOfOccurrences(); + } + + /** + * Set the numberOfOccurrences property: The number of times to repeat the access review. Required and must be + * positive if type is numbered. + * + * @param numberOfOccurrences the numberOfOccurrences value to set. + * @return the AccessReviewRecurrenceSettings object itself. + */ + public AccessReviewRecurrenceSettings withNumberOfOccurrences(Integer numberOfOccurrences) { + if (this.innerRange() == null) { + this.innerRange = new AccessReviewRecurrenceRange(); + } + this.innerRange().withNumberOfOccurrences(numberOfOccurrences); + return this; + } + + /** + * Get the startDate property: The DateTime when the review is scheduled to be start. This could be a date in the + * future. Required on create. + * + * @return the startDate value. + */ + public OffsetDateTime startDate() { + return this.innerRange() == null ? null : this.innerRange().startDate(); + } + + /** + * Set the startDate property: The DateTime when the review is scheduled to be start. This could be a date in the + * future. Required on create. + * + * @param startDate the startDate value to set. + * @return the AccessReviewRecurrenceSettings object itself. + */ + public AccessReviewRecurrenceSettings withStartDate(OffsetDateTime startDate) { + if (this.innerRange() == null) { + this.innerRange = new AccessReviewRecurrenceRange(); + } + this.innerRange().withStartDate(startDate); + return this; + } + + /** + * Get the endDate property: The DateTime when the review is scheduled to end. Required if type is endDate. + * + * @return the endDate value. + */ + public OffsetDateTime endDate() { + return this.innerRange() == null ? null : this.innerRange().endDate(); + } + + /** + * Set the endDate property: The DateTime when the review is scheduled to end. Required if type is endDate. + * + * @param endDate the endDate value to set. + * @return the AccessReviewRecurrenceSettings object itself. + */ + public AccessReviewRecurrenceSettings withEndDate(OffsetDateTime endDate) { + if (this.innerRange() == null) { + this.innerRange = new AccessReviewRecurrenceRange(); + } + this.innerRange().withEndDate(endDate); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerPattern() != null) { + innerPattern().validate(); + } + if (innerRange() != null) { + innerRange().validate(); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewScheduleDefinitionInner.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewScheduleDefinitionInner.java new file mode 100644 index 0000000000000..ea0242035347a --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewScheduleDefinitionInner.java @@ -0,0 +1,720 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewActorIdentityType; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewRecurrencePatternType; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewRecurrenceRangeType; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewReviewer; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewScheduleDefinitionReviewersType; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewScheduleDefinitionStatus; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewScopeAssignmentState; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewScopePrincipalType; +import com.azure.resourcemanager.authorization.generated.models.DefaultDecisionType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.List; + +/** Access Review Schedule Definition. */ +@Fluent +public final class AccessReviewScheduleDefinitionInner extends ProxyResource { + /* + * Access Review properties. + */ + @JsonProperty(value = "properties") + private AccessReviewScheduleDefinitionProperties innerProperties; + + /** + * Get the innerProperties property: Access Review properties. + * + * @return the innerProperties value. + */ + private AccessReviewScheduleDefinitionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the displayName property: The display name for the schedule definition. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Set the displayName property: The display name for the schedule definition. + * + * @param displayName the displayName value to set. + * @return the AccessReviewScheduleDefinitionInner object itself. + */ + public AccessReviewScheduleDefinitionInner withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewScheduleDefinitionProperties(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } + + /** + * Get the status property: This read-only field specifies the status of an accessReview. + * + * @return the status value. + */ + public AccessReviewScheduleDefinitionStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the descriptionForAdmins property: The description provided by the access review creator and visible to + * admins. + * + * @return the descriptionForAdmins value. + */ + public String descriptionForAdmins() { + return this.innerProperties() == null ? null : this.innerProperties().descriptionForAdmins(); + } + + /** + * Set the descriptionForAdmins property: The description provided by the access review creator and visible to + * admins. + * + * @param descriptionForAdmins the descriptionForAdmins value to set. + * @return the AccessReviewScheduleDefinitionInner object itself. + */ + public AccessReviewScheduleDefinitionInner withDescriptionForAdmins(String descriptionForAdmins) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewScheduleDefinitionProperties(); + } + this.innerProperties().withDescriptionForAdmins(descriptionForAdmins); + return this; + } + + /** + * Get the descriptionForReviewers property: The description provided by the access review creator to be shown to + * reviewers. + * + * @return the descriptionForReviewers value. + */ + public String descriptionForReviewers() { + return this.innerProperties() == null ? null : this.innerProperties().descriptionForReviewers(); + } + + /** + * Set the descriptionForReviewers property: The description provided by the access review creator to be shown to + * reviewers. + * + * @param descriptionForReviewers the descriptionForReviewers value to set. + * @return the AccessReviewScheduleDefinitionInner object itself. + */ + public AccessReviewScheduleDefinitionInner withDescriptionForReviewers(String descriptionForReviewers) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewScheduleDefinitionProperties(); + } + this.innerProperties().withDescriptionForReviewers(descriptionForReviewers); + return this; + } + + /** + * Get the reviewers property: This is the collection of reviewers. + * + * @return the reviewers value. + */ + public List reviewers() { + return this.innerProperties() == null ? null : this.innerProperties().reviewers(); + } + + /** + * Set the reviewers property: This is the collection of reviewers. + * + * @param reviewers the reviewers value to set. + * @return the AccessReviewScheduleDefinitionInner object itself. + */ + public AccessReviewScheduleDefinitionInner withReviewers(List reviewers) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewScheduleDefinitionProperties(); + } + this.innerProperties().withReviewers(reviewers); + return this; + } + + /** + * Get the backupReviewers property: This is the collection of backup reviewers. + * + * @return the backupReviewers value. + */ + public List backupReviewers() { + return this.innerProperties() == null ? null : this.innerProperties().backupReviewers(); + } + + /** + * Set the backupReviewers property: This is the collection of backup reviewers. + * + * @param backupReviewers the backupReviewers value to set. + * @return the AccessReviewScheduleDefinitionInner object itself. + */ + public AccessReviewScheduleDefinitionInner withBackupReviewers(List backupReviewers) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewScheduleDefinitionProperties(); + } + this.innerProperties().withBackupReviewers(backupReviewers); + return this; + } + + /** + * Get the reviewersType property: 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. + * + * @return the reviewersType value. + */ + public AccessReviewScheduleDefinitionReviewersType reviewersType() { + return this.innerProperties() == null ? null : this.innerProperties().reviewersType(); + } + + /** + * Get the instances property: This is the collection of instances returned when one does an expand on it. + * + * @return the instances value. + */ + public List instances() { + return this.innerProperties() == null ? null : this.innerProperties().instances(); + } + + /** + * Set the instances property: This is the collection of instances returned when one does an expand on it. + * + * @param instances the instances value to set. + * @return the AccessReviewScheduleDefinitionInner object itself. + */ + public AccessReviewScheduleDefinitionInner withInstances(List instances) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewScheduleDefinitionProperties(); + } + this.innerProperties().withInstances(instances); + return this; + } + + /** + * Get the principalId property: The identity id. + * + * @return the principalId value. + */ + public String principalId() { + return this.innerProperties() == null ? null : this.innerProperties().principalId(); + } + + /** + * Get the principalType property: The identity type : user/servicePrincipal. + * + * @return the principalType value. + */ + public AccessReviewActorIdentityType principalType() { + return this.innerProperties() == null ? null : this.innerProperties().principalType(); + } + + /** + * Get the principalName property: The identity display name. + * + * @return the principalName value. + */ + public String principalName() { + return this.innerProperties() == null ? null : this.innerProperties().principalName(); + } + + /** + * Get the userPrincipalName property: The user principal name(if valid). + * + * @return the userPrincipalName value. + */ + public String userPrincipalName() { + return this.innerProperties() == null ? null : this.innerProperties().userPrincipalName(); + } + + /** + * Get the mailNotificationsEnabled property: Flag to indicate whether sending mails to reviewers and the review + * creator is enabled. + * + * @return the mailNotificationsEnabled value. + */ + public Boolean mailNotificationsEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().mailNotificationsEnabled(); + } + + /** + * Set the mailNotificationsEnabled property: Flag to indicate whether sending mails to reviewers and the review + * creator is enabled. + * + * @param mailNotificationsEnabled the mailNotificationsEnabled value to set. + * @return the AccessReviewScheduleDefinitionInner object itself. + */ + public AccessReviewScheduleDefinitionInner withMailNotificationsEnabled(Boolean mailNotificationsEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewScheduleDefinitionProperties(); + } + this.innerProperties().withMailNotificationsEnabled(mailNotificationsEnabled); + return this; + } + + /** + * Get the reminderNotificationsEnabled property: Flag to indicate whether sending reminder emails to reviewers are + * enabled. + * + * @return the reminderNotificationsEnabled value. + */ + public Boolean reminderNotificationsEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().reminderNotificationsEnabled(); + } + + /** + * Set the reminderNotificationsEnabled property: Flag to indicate whether sending reminder emails to reviewers are + * enabled. + * + * @param reminderNotificationsEnabled the reminderNotificationsEnabled value to set. + * @return the AccessReviewScheduleDefinitionInner object itself. + */ + public AccessReviewScheduleDefinitionInner withReminderNotificationsEnabled(Boolean reminderNotificationsEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewScheduleDefinitionProperties(); + } + this.innerProperties().withReminderNotificationsEnabled(reminderNotificationsEnabled); + return this; + } + + /** + * Get the defaultDecisionEnabled property: Flag to indicate whether reviewers are required to provide a + * justification when reviewing access. + * + * @return the defaultDecisionEnabled value. + */ + public Boolean defaultDecisionEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().defaultDecisionEnabled(); + } + + /** + * Set the defaultDecisionEnabled property: Flag to indicate whether reviewers are required to provide a + * justification when reviewing access. + * + * @param defaultDecisionEnabled the defaultDecisionEnabled value to set. + * @return the AccessReviewScheduleDefinitionInner object itself. + */ + public AccessReviewScheduleDefinitionInner withDefaultDecisionEnabled(Boolean defaultDecisionEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewScheduleDefinitionProperties(); + } + this.innerProperties().withDefaultDecisionEnabled(defaultDecisionEnabled); + return this; + } + + /** + * Get the justificationRequiredOnApproval property: Flag to indicate whether the reviewer is required to pass + * justification when recording a decision. + * + * @return the justificationRequiredOnApproval value. + */ + public Boolean justificationRequiredOnApproval() { + return this.innerProperties() == null ? null : this.innerProperties().justificationRequiredOnApproval(); + } + + /** + * Set the justificationRequiredOnApproval property: Flag to indicate whether the reviewer is required to pass + * justification when recording a decision. + * + * @param justificationRequiredOnApproval the justificationRequiredOnApproval value to set. + * @return the AccessReviewScheduleDefinitionInner object itself. + */ + public AccessReviewScheduleDefinitionInner withJustificationRequiredOnApproval( + Boolean justificationRequiredOnApproval) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewScheduleDefinitionProperties(); + } + this.innerProperties().withJustificationRequiredOnApproval(justificationRequiredOnApproval); + return this; + } + + /** + * Get the defaultDecision property: This specifies the behavior for the autoReview feature when an access review + * completes. + * + * @return the defaultDecision value. + */ + public DefaultDecisionType defaultDecision() { + return this.innerProperties() == null ? null : this.innerProperties().defaultDecision(); + } + + /** + * Set the defaultDecision property: This specifies the behavior for the autoReview feature when an access review + * completes. + * + * @param defaultDecision the defaultDecision value to set. + * @return the AccessReviewScheduleDefinitionInner object itself. + */ + public AccessReviewScheduleDefinitionInner withDefaultDecision(DefaultDecisionType defaultDecision) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewScheduleDefinitionProperties(); + } + this.innerProperties().withDefaultDecision(defaultDecision); + return this; + } + + /** + * Get the autoApplyDecisionsEnabled property: 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. + * + * @return the autoApplyDecisionsEnabled value. + */ + public Boolean autoApplyDecisionsEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().autoApplyDecisionsEnabled(); + } + + /** + * Set the autoApplyDecisionsEnabled property: 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. + * + * @param autoApplyDecisionsEnabled the autoApplyDecisionsEnabled value to set. + * @return the AccessReviewScheduleDefinitionInner object itself. + */ + public AccessReviewScheduleDefinitionInner withAutoApplyDecisionsEnabled(Boolean autoApplyDecisionsEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewScheduleDefinitionProperties(); + } + this.innerProperties().withAutoApplyDecisionsEnabled(autoApplyDecisionsEnabled); + return this; + } + + /** + * Get the recommendationsEnabled property: Flag to indicate whether showing recommendations to reviewers is + * enabled. + * + * @return the recommendationsEnabled value. + */ + public Boolean recommendationsEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().recommendationsEnabled(); + } + + /** + * Set the recommendationsEnabled property: Flag to indicate whether showing recommendations to reviewers is + * enabled. + * + * @param recommendationsEnabled the recommendationsEnabled value to set. + * @return the AccessReviewScheduleDefinitionInner object itself. + */ + public AccessReviewScheduleDefinitionInner withRecommendationsEnabled(Boolean recommendationsEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewScheduleDefinitionProperties(); + } + this.innerProperties().withRecommendationsEnabled(recommendationsEnabled); + return this; + } + + /** + * Get the recommendationLookBackDuration property: 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)). + * + * @return the recommendationLookBackDuration value. + */ + public Duration recommendationLookBackDuration() { + return this.innerProperties() == null ? null : this.innerProperties().recommendationLookBackDuration(); + } + + /** + * Set the recommendationLookBackDuration property: 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)). + * + * @param recommendationLookBackDuration the recommendationLookBackDuration value to set. + * @return the AccessReviewScheduleDefinitionInner object itself. + */ + public AccessReviewScheduleDefinitionInner withRecommendationLookBackDuration( + Duration recommendationLookBackDuration) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewScheduleDefinitionProperties(); + } + this.innerProperties().withRecommendationLookBackDuration(recommendationLookBackDuration); + return this; + } + + /** + * Get the instanceDurationInDays property: The duration in days for an instance. + * + * @return the instanceDurationInDays value. + */ + public Integer instanceDurationInDays() { + return this.innerProperties() == null ? null : this.innerProperties().instanceDurationInDays(); + } + + /** + * Set the instanceDurationInDays property: The duration in days for an instance. + * + * @param instanceDurationInDays the instanceDurationInDays value to set. + * @return the AccessReviewScheduleDefinitionInner object itself. + */ + public AccessReviewScheduleDefinitionInner withInstanceDurationInDays(Integer instanceDurationInDays) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewScheduleDefinitionProperties(); + } + this.innerProperties().withInstanceDurationInDays(instanceDurationInDays); + return this; + } + + /** + * Get the type property: The recurrence type : weekly, monthly, etc. + * + * @return the type value. + */ + public AccessReviewRecurrencePatternType typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Set the type property: The recurrence type : weekly, monthly, etc. + * + * @param type the type value to set. + * @return the AccessReviewScheduleDefinitionInner object itself. + */ + public AccessReviewScheduleDefinitionInner withTypePropertiesType(AccessReviewRecurrencePatternType type) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewScheduleDefinitionProperties(); + } + this.innerProperties().withType(type); + return this; + } + + /** + * Get the interval property: The interval for recurrence. For a quarterly review, the interval is 3 for type : + * absoluteMonthly. + * + * @return the interval value. + */ + public Integer interval() { + return this.innerProperties() == null ? null : this.innerProperties().interval(); + } + + /** + * Set the interval property: The interval for recurrence. For a quarterly review, the interval is 3 for type : + * absoluteMonthly. + * + * @param interval the interval value to set. + * @return the AccessReviewScheduleDefinitionInner object itself. + */ + public AccessReviewScheduleDefinitionInner withInterval(Integer interval) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewScheduleDefinitionProperties(); + } + this.innerProperties().withInterval(interval); + return this; + } + + /** + * Get the typeRangeType property: The recurrence range type. The possible values are: endDate, noEnd, numbered. + * + * @return the typeRangeType value. + */ + public AccessReviewRecurrenceRangeType typeRangeType() { + return this.innerProperties() == null ? null : this.innerProperties().typeRangeType(); + } + + /** + * Set the typeRangeType property: The recurrence range type. The possible values are: endDate, noEnd, numbered. + * + * @param typeRangeType the typeRangeType value to set. + * @return the AccessReviewScheduleDefinitionInner object itself. + */ + public AccessReviewScheduleDefinitionInner withTypeRangeType(AccessReviewRecurrenceRangeType typeRangeType) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewScheduleDefinitionProperties(); + } + this.innerProperties().withTypeRangeType(typeRangeType); + return this; + } + + /** + * Get the numberOfOccurrences property: The number of times to repeat the access review. Required and must be + * positive if type is numbered. + * + * @return the numberOfOccurrences value. + */ + public Integer numberOfOccurrences() { + return this.innerProperties() == null ? null : this.innerProperties().numberOfOccurrences(); + } + + /** + * Set the numberOfOccurrences property: The number of times to repeat the access review. Required and must be + * positive if type is numbered. + * + * @param numberOfOccurrences the numberOfOccurrences value to set. + * @return the AccessReviewScheduleDefinitionInner object itself. + */ + public AccessReviewScheduleDefinitionInner withNumberOfOccurrences(Integer numberOfOccurrences) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewScheduleDefinitionProperties(); + } + this.innerProperties().withNumberOfOccurrences(numberOfOccurrences); + return this; + } + + /** + * Get the startDate property: The DateTime when the review is scheduled to be start. This could be a date in the + * future. Required on create. + * + * @return the startDate value. + */ + public OffsetDateTime startDate() { + return this.innerProperties() == null ? null : this.innerProperties().startDate(); + } + + /** + * Set the startDate property: The DateTime when the review is scheduled to be start. This could be a date in the + * future. Required on create. + * + * @param startDate the startDate value to set. + * @return the AccessReviewScheduleDefinitionInner object itself. + */ + public AccessReviewScheduleDefinitionInner withStartDate(OffsetDateTime startDate) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewScheduleDefinitionProperties(); + } + this.innerProperties().withStartDate(startDate); + return this; + } + + /** + * Get the endDate property: The DateTime when the review is scheduled to end. Required if type is endDate. + * + * @return the endDate value. + */ + public OffsetDateTime endDate() { + return this.innerProperties() == null ? null : this.innerProperties().endDate(); + } + + /** + * Set the endDate property: The DateTime when the review is scheduled to end. Required if type is endDate. + * + * @param endDate the endDate value to set. + * @return the AccessReviewScheduleDefinitionInner object itself. + */ + public AccessReviewScheduleDefinitionInner withEndDate(OffsetDateTime endDate) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessReviewScheduleDefinitionProperties(); + } + this.innerProperties().withEndDate(endDate); + return this; + } + + /** + * Get the resourceId property: ResourceId in which this review is getting created. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.innerProperties() == null ? null : this.innerProperties().resourceId(); + } + + /** + * Get the roleDefinitionId property: This is used to indicate the role being reviewed. + * + * @return the roleDefinitionId value. + */ + public String roleDefinitionId() { + return this.innerProperties() == null ? null : this.innerProperties().roleDefinitionId(); + } + + /** + * Get the principalTypeScopePrincipalType property: The identity type user/servicePrincipal to review. + * + * @return the principalTypeScopePrincipalType value. + */ + public AccessReviewScopePrincipalType principalTypeScopePrincipalType() { + return this.innerProperties() == null ? null : this.innerProperties().principalTypeScopePrincipalType(); + } + + /** + * Get the assignmentState property: The role assignment state eligible/active to review. + * + * @return the assignmentState value. + */ + public AccessReviewScopeAssignmentState assignmentState() { + return this.innerProperties() == null ? null : this.innerProperties().assignmentState(); + } + + /** + * Get the inactiveDuration property: 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)). + * + * @return the inactiveDuration value. + */ + public Duration inactiveDuration() { + return this.innerProperties() == null ? null : this.innerProperties().inactiveDuration(); + } + + /** + * Get the expandNestedMemberships property: Flag to indicate whether to expand nested memberships or not. + * + * @return the expandNestedMemberships value. + */ + public Boolean expandNestedMemberships() { + return this.innerProperties() == null ? null : this.innerProperties().expandNestedMemberships(); + } + + /** + * Get the includeInheritedAccess property: Flag to indicate whether to expand nested memberships or not. + * + * @return the includeInheritedAccess value. + */ + public Boolean includeInheritedAccess() { + return this.innerProperties() == null ? null : this.innerProperties().includeInheritedAccess(); + } + + /** + * Get the includeAccessBelowResource property: Flag to indicate whether to expand nested memberships or not. + * + * @return the includeAccessBelowResource value. + */ + public Boolean includeAccessBelowResource() { + return this.innerProperties() == null ? null : this.innerProperties().includeAccessBelowResource(); + } + + /** + * Get the excludeResourceId property: This is used to indicate the resource id(s) to exclude. + * + * @return the excludeResourceId value. + */ + public String excludeResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().excludeResourceId(); + } + + /** + * Get the excludeRoleDefinitionId property: This is used to indicate the role definition id(s) to exclude. + * + * @return the excludeRoleDefinitionId value. + */ + public String excludeRoleDefinitionId() { + return this.innerProperties() == null ? null : this.innerProperties().excludeRoleDefinitionId(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewScheduleDefinitionProperties.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewScheduleDefinitionProperties.java new file mode 100644 index 0000000000000..8fd68a11f5209 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewScheduleDefinitionProperties.java @@ -0,0 +1,885 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewActorIdentityType; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewRecurrencePatternType; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewRecurrenceRangeType; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewReviewer; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewScheduleDefinitionReviewersType; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewScheduleDefinitionStatus; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewScopeAssignmentState; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewScopePrincipalType; +import com.azure.resourcemanager.authorization.generated.models.DefaultDecisionType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.List; + +/** Access Review. */ +@Fluent +public final class AccessReviewScheduleDefinitionProperties { + /* + * The display name for the schedule definition. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * This read-only field specifies the status of an accessReview. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private AccessReviewScheduleDefinitionStatus status; + + /* + * The description provided by the access review creator and visible to admins. + */ + @JsonProperty(value = "descriptionForAdmins") + private String descriptionForAdmins; + + /* + * The description provided by the access review creator to be shown to reviewers. + */ + @JsonProperty(value = "descriptionForReviewers") + private String descriptionForReviewers; + + /* + * The user or other identity who created this review. + */ + @JsonProperty(value = "createdBy", access = JsonProperty.Access.WRITE_ONLY) + private AccessReviewActorIdentity innerCreatedBy; + + /* + * Access Review Settings. + */ + @JsonProperty(value = "settings") + private AccessReviewScheduleSettings innerSettings; + + /* + * This is used to define what to include in scope of the review. The scope definition includes the resourceId and + * roleDefinitionId. + */ + @JsonProperty(value = "scope", access = JsonProperty.Access.WRITE_ONLY) + private AccessReviewScope innerScope; + + /* + * This is the collection of reviewers. + */ + @JsonProperty(value = "reviewers") + private List reviewers; + + /* + * This is the collection of backup reviewers. + */ + @JsonProperty(value = "backupReviewers") + private List backupReviewers; + + /* + * 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. + */ + @JsonProperty(value = "reviewersType", access = JsonProperty.Access.WRITE_ONLY) + private AccessReviewScheduleDefinitionReviewersType reviewersType; + + /* + * This is the collection of instances returned when one does an expand on it. + */ + @JsonProperty(value = "instances") + private List instances; + + /** + * Get the displayName property: The display name for the schedule definition. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name for the schedule definition. + * + * @param displayName the displayName value to set. + * @return the AccessReviewScheduleDefinitionProperties object itself. + */ + public AccessReviewScheduleDefinitionProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the status property: This read-only field specifies the status of an accessReview. + * + * @return the status value. + */ + public AccessReviewScheduleDefinitionStatus status() { + return this.status; + } + + /** + * Get the descriptionForAdmins property: The description provided by the access review creator and visible to + * admins. + * + * @return the descriptionForAdmins value. + */ + public String descriptionForAdmins() { + return this.descriptionForAdmins; + } + + /** + * Set the descriptionForAdmins property: The description provided by the access review creator and visible to + * admins. + * + * @param descriptionForAdmins the descriptionForAdmins value to set. + * @return the AccessReviewScheduleDefinitionProperties object itself. + */ + public AccessReviewScheduleDefinitionProperties withDescriptionForAdmins(String descriptionForAdmins) { + this.descriptionForAdmins = descriptionForAdmins; + return this; + } + + /** + * Get the descriptionForReviewers property: The description provided by the access review creator to be shown to + * reviewers. + * + * @return the descriptionForReviewers value. + */ + public String descriptionForReviewers() { + return this.descriptionForReviewers; + } + + /** + * Set the descriptionForReviewers property: The description provided by the access review creator to be shown to + * reviewers. + * + * @param descriptionForReviewers the descriptionForReviewers value to set. + * @return the AccessReviewScheduleDefinitionProperties object itself. + */ + public AccessReviewScheduleDefinitionProperties withDescriptionForReviewers(String descriptionForReviewers) { + this.descriptionForReviewers = descriptionForReviewers; + return this; + } + + /** + * Get the innerCreatedBy property: The user or other identity who created this review. + * + * @return the innerCreatedBy value. + */ + private AccessReviewActorIdentity innerCreatedBy() { + return this.innerCreatedBy; + } + + /** + * Get the innerSettings property: Access Review Settings. + * + * @return the innerSettings value. + */ + private AccessReviewScheduleSettings innerSettings() { + return this.innerSettings; + } + + /** + * Get the innerScope property: This is used to define what to include in scope of the review. The scope definition + * includes the resourceId and roleDefinitionId. + * + * @return the innerScope value. + */ + private AccessReviewScope innerScope() { + return this.innerScope; + } + + /** + * Get the reviewers property: This is the collection of reviewers. + * + * @return the reviewers value. + */ + public List reviewers() { + return this.reviewers; + } + + /** + * Set the reviewers property: This is the collection of reviewers. + * + * @param reviewers the reviewers value to set. + * @return the AccessReviewScheduleDefinitionProperties object itself. + */ + public AccessReviewScheduleDefinitionProperties withReviewers(List reviewers) { + this.reviewers = reviewers; + return this; + } + + /** + * Get the backupReviewers property: This is the collection of backup reviewers. + * + * @return the backupReviewers value. + */ + public List backupReviewers() { + return this.backupReviewers; + } + + /** + * Set the backupReviewers property: This is the collection of backup reviewers. + * + * @param backupReviewers the backupReviewers value to set. + * @return the AccessReviewScheduleDefinitionProperties object itself. + */ + public AccessReviewScheduleDefinitionProperties withBackupReviewers(List backupReviewers) { + this.backupReviewers = backupReviewers; + return this; + } + + /** + * Get the reviewersType property: 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. + * + * @return the reviewersType value. + */ + public AccessReviewScheduleDefinitionReviewersType reviewersType() { + return this.reviewersType; + } + + /** + * Get the instances property: This is the collection of instances returned when one does an expand on it. + * + * @return the instances value. + */ + public List instances() { + return this.instances; + } + + /** + * Set the instances property: This is the collection of instances returned when one does an expand on it. + * + * @param instances the instances value to set. + * @return the AccessReviewScheduleDefinitionProperties object itself. + */ + public AccessReviewScheduleDefinitionProperties withInstances(List instances) { + this.instances = instances; + return this; + } + + /** + * Get the principalId property: The identity id. + * + * @return the principalId value. + */ + public String principalId() { + return this.innerCreatedBy() == null ? null : this.innerCreatedBy().principalId(); + } + + /** + * Get the principalType property: The identity type : user/servicePrincipal. + * + * @return the principalType value. + */ + public AccessReviewActorIdentityType principalType() { + return this.innerCreatedBy() == null ? null : this.innerCreatedBy().principalType(); + } + + /** + * Get the principalName property: The identity display name. + * + * @return the principalName value. + */ + public String principalName() { + return this.innerCreatedBy() == null ? null : this.innerCreatedBy().principalName(); + } + + /** + * Get the userPrincipalName property: The user principal name(if valid). + * + * @return the userPrincipalName value. + */ + public String userPrincipalName() { + return this.innerCreatedBy() == null ? null : this.innerCreatedBy().userPrincipalName(); + } + + /** + * Get the mailNotificationsEnabled property: Flag to indicate whether sending mails to reviewers and the review + * creator is enabled. + * + * @return the mailNotificationsEnabled value. + */ + public Boolean mailNotificationsEnabled() { + return this.innerSettings() == null ? null : this.innerSettings().mailNotificationsEnabled(); + } + + /** + * Set the mailNotificationsEnabled property: Flag to indicate whether sending mails to reviewers and the review + * creator is enabled. + * + * @param mailNotificationsEnabled the mailNotificationsEnabled value to set. + * @return the AccessReviewScheduleDefinitionProperties object itself. + */ + public AccessReviewScheduleDefinitionProperties withMailNotificationsEnabled(Boolean mailNotificationsEnabled) { + if (this.innerSettings() == null) { + this.innerSettings = new AccessReviewScheduleSettings(); + } + this.innerSettings().withMailNotificationsEnabled(mailNotificationsEnabled); + return this; + } + + /** + * Get the reminderNotificationsEnabled property: Flag to indicate whether sending reminder emails to reviewers are + * enabled. + * + * @return the reminderNotificationsEnabled value. + */ + public Boolean reminderNotificationsEnabled() { + return this.innerSettings() == null ? null : this.innerSettings().reminderNotificationsEnabled(); + } + + /** + * Set the reminderNotificationsEnabled property: Flag to indicate whether sending reminder emails to reviewers are + * enabled. + * + * @param reminderNotificationsEnabled the reminderNotificationsEnabled value to set. + * @return the AccessReviewScheduleDefinitionProperties object itself. + */ + public AccessReviewScheduleDefinitionProperties withReminderNotificationsEnabled( + Boolean reminderNotificationsEnabled) { + if (this.innerSettings() == null) { + this.innerSettings = new AccessReviewScheduleSettings(); + } + this.innerSettings().withReminderNotificationsEnabled(reminderNotificationsEnabled); + return this; + } + + /** + * Get the defaultDecisionEnabled property: Flag to indicate whether reviewers are required to provide a + * justification when reviewing access. + * + * @return the defaultDecisionEnabled value. + */ + public Boolean defaultDecisionEnabled() { + return this.innerSettings() == null ? null : this.innerSettings().defaultDecisionEnabled(); + } + + /** + * Set the defaultDecisionEnabled property: Flag to indicate whether reviewers are required to provide a + * justification when reviewing access. + * + * @param defaultDecisionEnabled the defaultDecisionEnabled value to set. + * @return the AccessReviewScheduleDefinitionProperties object itself. + */ + public AccessReviewScheduleDefinitionProperties withDefaultDecisionEnabled(Boolean defaultDecisionEnabled) { + if (this.innerSettings() == null) { + this.innerSettings = new AccessReviewScheduleSettings(); + } + this.innerSettings().withDefaultDecisionEnabled(defaultDecisionEnabled); + return this; + } + + /** + * Get the justificationRequiredOnApproval property: Flag to indicate whether the reviewer is required to pass + * justification when recording a decision. + * + * @return the justificationRequiredOnApproval value. + */ + public Boolean justificationRequiredOnApproval() { + return this.innerSettings() == null ? null : this.innerSettings().justificationRequiredOnApproval(); + } + + /** + * Set the justificationRequiredOnApproval property: Flag to indicate whether the reviewer is required to pass + * justification when recording a decision. + * + * @param justificationRequiredOnApproval the justificationRequiredOnApproval value to set. + * @return the AccessReviewScheduleDefinitionProperties object itself. + */ + public AccessReviewScheduleDefinitionProperties withJustificationRequiredOnApproval( + Boolean justificationRequiredOnApproval) { + if (this.innerSettings() == null) { + this.innerSettings = new AccessReviewScheduleSettings(); + } + this.innerSettings().withJustificationRequiredOnApproval(justificationRequiredOnApproval); + return this; + } + + /** + * Get the defaultDecision property: This specifies the behavior for the autoReview feature when an access review + * completes. + * + * @return the defaultDecision value. + */ + public DefaultDecisionType defaultDecision() { + return this.innerSettings() == null ? null : this.innerSettings().defaultDecision(); + } + + /** + * Set the defaultDecision property: This specifies the behavior for the autoReview feature when an access review + * completes. + * + * @param defaultDecision the defaultDecision value to set. + * @return the AccessReviewScheduleDefinitionProperties object itself. + */ + public AccessReviewScheduleDefinitionProperties withDefaultDecision(DefaultDecisionType defaultDecision) { + if (this.innerSettings() == null) { + this.innerSettings = new AccessReviewScheduleSettings(); + } + this.innerSettings().withDefaultDecision(defaultDecision); + return this; + } + + /** + * Get the autoApplyDecisionsEnabled property: 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. + * + * @return the autoApplyDecisionsEnabled value. + */ + public Boolean autoApplyDecisionsEnabled() { + return this.innerSettings() == null ? null : this.innerSettings().autoApplyDecisionsEnabled(); + } + + /** + * Set the autoApplyDecisionsEnabled property: 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. + * + * @param autoApplyDecisionsEnabled the autoApplyDecisionsEnabled value to set. + * @return the AccessReviewScheduleDefinitionProperties object itself. + */ + public AccessReviewScheduleDefinitionProperties withAutoApplyDecisionsEnabled(Boolean autoApplyDecisionsEnabled) { + if (this.innerSettings() == null) { + this.innerSettings = new AccessReviewScheduleSettings(); + } + this.innerSettings().withAutoApplyDecisionsEnabled(autoApplyDecisionsEnabled); + return this; + } + + /** + * Get the recommendationsEnabled property: Flag to indicate whether showing recommendations to reviewers is + * enabled. + * + * @return the recommendationsEnabled value. + */ + public Boolean recommendationsEnabled() { + return this.innerSettings() == null ? null : this.innerSettings().recommendationsEnabled(); + } + + /** + * Set the recommendationsEnabled property: Flag to indicate whether showing recommendations to reviewers is + * enabled. + * + * @param recommendationsEnabled the recommendationsEnabled value to set. + * @return the AccessReviewScheduleDefinitionProperties object itself. + */ + public AccessReviewScheduleDefinitionProperties withRecommendationsEnabled(Boolean recommendationsEnabled) { + if (this.innerSettings() == null) { + this.innerSettings = new AccessReviewScheduleSettings(); + } + this.innerSettings().withRecommendationsEnabled(recommendationsEnabled); + return this; + } + + /** + * Get the recommendationLookBackDuration property: 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)). + * + * @return the recommendationLookBackDuration value. + */ + public Duration recommendationLookBackDuration() { + return this.innerSettings() == null ? null : this.innerSettings().recommendationLookBackDuration(); + } + + /** + * Set the recommendationLookBackDuration property: 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)). + * + * @param recommendationLookBackDuration the recommendationLookBackDuration value to set. + * @return the AccessReviewScheduleDefinitionProperties object itself. + */ + public AccessReviewScheduleDefinitionProperties withRecommendationLookBackDuration( + Duration recommendationLookBackDuration) { + if (this.innerSettings() == null) { + this.innerSettings = new AccessReviewScheduleSettings(); + } + this.innerSettings().withRecommendationLookBackDuration(recommendationLookBackDuration); + return this; + } + + /** + * Get the instanceDurationInDays property: The duration in days for an instance. + * + * @return the instanceDurationInDays value. + */ + public Integer instanceDurationInDays() { + return this.innerSettings() == null ? null : this.innerSettings().instanceDurationInDays(); + } + + /** + * Set the instanceDurationInDays property: The duration in days for an instance. + * + * @param instanceDurationInDays the instanceDurationInDays value to set. + * @return the AccessReviewScheduleDefinitionProperties object itself. + */ + public AccessReviewScheduleDefinitionProperties withInstanceDurationInDays(Integer instanceDurationInDays) { + if (this.innerSettings() == null) { + this.innerSettings = new AccessReviewScheduleSettings(); + } + this.innerSettings().withInstanceDurationInDays(instanceDurationInDays); + return this; + } + + /** + * Get the type property: The recurrence type : weekly, monthly, etc. + * + * @return the type value. + */ + public AccessReviewRecurrencePatternType type() { + return this.innerSettings() == null ? null : this.innerSettings().type(); + } + + /** + * Set the type property: The recurrence type : weekly, monthly, etc. + * + * @param type the type value to set. + * @return the AccessReviewScheduleDefinitionProperties object itself. + */ + public AccessReviewScheduleDefinitionProperties withType(AccessReviewRecurrencePatternType type) { + if (this.innerSettings() == null) { + this.innerSettings = new AccessReviewScheduleSettings(); + } + this.innerSettings().withType(type); + return this; + } + + /** + * Get the interval property: The interval for recurrence. For a quarterly review, the interval is 3 for type : + * absoluteMonthly. + * + * @return the interval value. + */ + public Integer interval() { + return this.innerSettings() == null ? null : this.innerSettings().interval(); + } + + /** + * Set the interval property: The interval for recurrence. For a quarterly review, the interval is 3 for type : + * absoluteMonthly. + * + * @param interval the interval value to set. + * @return the AccessReviewScheduleDefinitionProperties object itself. + */ + public AccessReviewScheduleDefinitionProperties withInterval(Integer interval) { + if (this.innerSettings() == null) { + this.innerSettings = new AccessReviewScheduleSettings(); + } + this.innerSettings().withInterval(interval); + return this; + } + + /** + * Get the typeRangeType property: The recurrence range type. The possible values are: endDate, noEnd, numbered. + * + * @return the typeRangeType value. + */ + public AccessReviewRecurrenceRangeType typeRangeType() { + return this.innerSettings() == null ? null : this.innerSettings().typeRangeType(); + } + + /** + * Set the typeRangeType property: The recurrence range type. The possible values are: endDate, noEnd, numbered. + * + * @param typeRangeType the typeRangeType value to set. + * @return the AccessReviewScheduleDefinitionProperties object itself. + */ + public AccessReviewScheduleDefinitionProperties withTypeRangeType(AccessReviewRecurrenceRangeType typeRangeType) { + if (this.innerSettings() == null) { + this.innerSettings = new AccessReviewScheduleSettings(); + } + this.innerSettings().withTypeRangeType(typeRangeType); + return this; + } + + /** + * Get the numberOfOccurrences property: The number of times to repeat the access review. Required and must be + * positive if type is numbered. + * + * @return the numberOfOccurrences value. + */ + public Integer numberOfOccurrences() { + return this.innerSettings() == null ? null : this.innerSettings().numberOfOccurrences(); + } + + /** + * Set the numberOfOccurrences property: The number of times to repeat the access review. Required and must be + * positive if type is numbered. + * + * @param numberOfOccurrences the numberOfOccurrences value to set. + * @return the AccessReviewScheduleDefinitionProperties object itself. + */ + public AccessReviewScheduleDefinitionProperties withNumberOfOccurrences(Integer numberOfOccurrences) { + if (this.innerSettings() == null) { + this.innerSettings = new AccessReviewScheduleSettings(); + } + this.innerSettings().withNumberOfOccurrences(numberOfOccurrences); + return this; + } + + /** + * Get the startDate property: The DateTime when the review is scheduled to be start. This could be a date in the + * future. Required on create. + * + * @return the startDate value. + */ + public OffsetDateTime startDate() { + return this.innerSettings() == null ? null : this.innerSettings().startDate(); + } + + /** + * Set the startDate property: The DateTime when the review is scheduled to be start. This could be a date in the + * future. Required on create. + * + * @param startDate the startDate value to set. + * @return the AccessReviewScheduleDefinitionProperties object itself. + */ + public AccessReviewScheduleDefinitionProperties withStartDate(OffsetDateTime startDate) { + if (this.innerSettings() == null) { + this.innerSettings = new AccessReviewScheduleSettings(); + } + this.innerSettings().withStartDate(startDate); + return this; + } + + /** + * Get the endDate property: The DateTime when the review is scheduled to end. Required if type is endDate. + * + * @return the endDate value. + */ + public OffsetDateTime endDate() { + return this.innerSettings() == null ? null : this.innerSettings().endDate(); + } + + /** + * Set the endDate property: The DateTime when the review is scheduled to end. Required if type is endDate. + * + * @param endDate the endDate value to set. + * @return the AccessReviewScheduleDefinitionProperties object itself. + */ + public AccessReviewScheduleDefinitionProperties withEndDate(OffsetDateTime endDate) { + if (this.innerSettings() == null) { + this.innerSettings = new AccessReviewScheduleSettings(); + } + this.innerSettings().withEndDate(endDate); + return this; + } + + /** + * Get the resourceId property: ResourceId in which this review is getting created. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.innerScope() == null ? null : this.innerScope().resourceId(); + } + + /** + * Get the roleDefinitionId property: This is used to indicate the role being reviewed. + * + * @return the roleDefinitionId value. + */ + public String roleDefinitionId() { + return this.innerScope() == null ? null : this.innerScope().roleDefinitionId(); + } + + /** + * Get the principalType property: The identity type user/servicePrincipal to review. + * + * @return the principalType value. + */ + public AccessReviewScopePrincipalType principalTypeScopePrincipalType() { + return this.innerScope() == null ? null : this.innerScope().principalType(); + } + + /** + * Get the assignmentState property: The role assignment state eligible/active to review. + * + * @return the assignmentState value. + */ + public AccessReviewScopeAssignmentState assignmentState() { + return this.innerScope() == null ? null : this.innerScope().assignmentState(); + } + + /** + * Get the inactiveDuration property: 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)). + * + * @return the inactiveDuration value. + */ + public Duration inactiveDuration() { + return this.innerScope() == null ? null : this.innerScope().inactiveDuration(); + } + + /** + * Set the inactiveDuration property: 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)). + * + * @param inactiveDuration the inactiveDuration value to set. + * @return the AccessReviewScheduleDefinitionProperties object itself. + */ + public AccessReviewScheduleDefinitionProperties withInactiveDuration(Duration inactiveDuration) { + if (this.innerScope() == null) { + this.innerScope = new AccessReviewScope(); + } + this.innerScope().withInactiveDuration(inactiveDuration); + return this; + } + + /** + * Get the expandNestedMemberships property: Flag to indicate whether to expand nested memberships or not. + * + * @return the expandNestedMemberships value. + */ + public Boolean expandNestedMemberships() { + return this.innerScope() == null ? null : this.innerScope().expandNestedMemberships(); + } + + /** + * Set the expandNestedMemberships property: Flag to indicate whether to expand nested memberships or not. + * + * @param expandNestedMemberships the expandNestedMemberships value to set. + * @return the AccessReviewScheduleDefinitionProperties object itself. + */ + public AccessReviewScheduleDefinitionProperties withExpandNestedMemberships(Boolean expandNestedMemberships) { + if (this.innerScope() == null) { + this.innerScope = new AccessReviewScope(); + } + this.innerScope().withExpandNestedMemberships(expandNestedMemberships); + return this; + } + + /** + * Get the includeInheritedAccess property: Flag to indicate whether to expand nested memberships or not. + * + * @return the includeInheritedAccess value. + */ + public Boolean includeInheritedAccess() { + return this.innerScope() == null ? null : this.innerScope().includeInheritedAccess(); + } + + /** + * Set the includeInheritedAccess property: Flag to indicate whether to expand nested memberships or not. + * + * @param includeInheritedAccess the includeInheritedAccess value to set. + * @return the AccessReviewScheduleDefinitionProperties object itself. + */ + public AccessReviewScheduleDefinitionProperties withIncludeInheritedAccess(Boolean includeInheritedAccess) { + if (this.innerScope() == null) { + this.innerScope = new AccessReviewScope(); + } + this.innerScope().withIncludeInheritedAccess(includeInheritedAccess); + return this; + } + + /** + * Get the includeAccessBelowResource property: Flag to indicate whether to expand nested memberships or not. + * + * @return the includeAccessBelowResource value. + */ + public Boolean includeAccessBelowResource() { + return this.innerScope() == null ? null : this.innerScope().includeAccessBelowResource(); + } + + /** + * Set the includeAccessBelowResource property: Flag to indicate whether to expand nested memberships or not. + * + * @param includeAccessBelowResource the includeAccessBelowResource value to set. + * @return the AccessReviewScheduleDefinitionProperties object itself. + */ + public AccessReviewScheduleDefinitionProperties withIncludeAccessBelowResource(Boolean includeAccessBelowResource) { + if (this.innerScope() == null) { + this.innerScope = new AccessReviewScope(); + } + this.innerScope().withIncludeAccessBelowResource(includeAccessBelowResource); + return this; + } + + /** + * Get the excludeResourceId property: This is used to indicate the resource id(s) to exclude. + * + * @return the excludeResourceId value. + */ + public String excludeResourceId() { + return this.innerScope() == null ? null : this.innerScope().excludeResourceId(); + } + + /** + * Set the excludeResourceId property: This is used to indicate the resource id(s) to exclude. + * + * @param excludeResourceId the excludeResourceId value to set. + * @return the AccessReviewScheduleDefinitionProperties object itself. + */ + public AccessReviewScheduleDefinitionProperties withExcludeResourceId(String excludeResourceId) { + if (this.innerScope() == null) { + this.innerScope = new AccessReviewScope(); + } + this.innerScope().withExcludeResourceId(excludeResourceId); + return this; + } + + /** + * Get the excludeRoleDefinitionId property: This is used to indicate the role definition id(s) to exclude. + * + * @return the excludeRoleDefinitionId value. + */ + public String excludeRoleDefinitionId() { + return this.innerScope() == null ? null : this.innerScope().excludeRoleDefinitionId(); + } + + /** + * Set the excludeRoleDefinitionId property: This is used to indicate the role definition id(s) to exclude. + * + * @param excludeRoleDefinitionId the excludeRoleDefinitionId value to set. + * @return the AccessReviewScheduleDefinitionProperties object itself. + */ + public AccessReviewScheduleDefinitionProperties withExcludeRoleDefinitionId(String excludeRoleDefinitionId) { + if (this.innerScope() == null) { + this.innerScope = new AccessReviewScope(); + } + this.innerScope().withExcludeRoleDefinitionId(excludeRoleDefinitionId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerCreatedBy() != null) { + innerCreatedBy().validate(); + } + if (innerSettings() != null) { + innerSettings().validate(); + } + if (innerScope() != null) { + innerScope().validate(); + } + if (reviewers() != null) { + reviewers().forEach(e -> e.validate()); + } + if (backupReviewers() != null) { + backupReviewers().forEach(e -> e.validate()); + } + if (instances() != null) { + instances().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewScheduleSettings.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewScheduleSettings.java new file mode 100644 index 0000000000000..b7de5098df9f6 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewScheduleSettings.java @@ -0,0 +1,452 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewRecurrencePatternType; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewRecurrenceRangeType; +import com.azure.resourcemanager.authorization.generated.models.DefaultDecisionType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; +import java.time.OffsetDateTime; + +/** Settings of an Access Review. */ +@Fluent +public final class AccessReviewScheduleSettings { + /* + * Flag to indicate whether sending mails to reviewers and the review creator is enabled. + */ + @JsonProperty(value = "mailNotificationsEnabled") + private Boolean mailNotificationsEnabled; + + /* + * Flag to indicate whether sending reminder emails to reviewers are enabled. + */ + @JsonProperty(value = "reminderNotificationsEnabled") + private Boolean reminderNotificationsEnabled; + + /* + * Flag to indicate whether reviewers are required to provide a justification when reviewing access. + */ + @JsonProperty(value = "defaultDecisionEnabled") + private Boolean defaultDecisionEnabled; + + /* + * Flag to indicate whether the reviewer is required to pass justification when recording a decision. + */ + @JsonProperty(value = "justificationRequiredOnApproval") + private Boolean justificationRequiredOnApproval; + + /* + * This specifies the behavior for the autoReview feature when an access review completes. + */ + @JsonProperty(value = "defaultDecision") + private DefaultDecisionType defaultDecision; + + /* + * 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. + */ + @JsonProperty(value = "autoApplyDecisionsEnabled") + private Boolean autoApplyDecisionsEnabled; + + /* + * Flag to indicate whether showing recommendations to reviewers is enabled. + */ + @JsonProperty(value = "recommendationsEnabled") + private Boolean recommendationsEnabled; + + /* + * 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)) + */ + @JsonProperty(value = "recommendationLookBackDuration") + private Duration recommendationLookBackDuration; + + /* + * The duration in days for an instance. + */ + @JsonProperty(value = "instanceDurationInDays") + private Integer instanceDurationInDays; + + /* + * Access Review Settings. + */ + @JsonProperty(value = "recurrence") + private AccessReviewRecurrenceSettings innerRecurrence; + + /** + * Get the mailNotificationsEnabled property: Flag to indicate whether sending mails to reviewers and the review + * creator is enabled. + * + * @return the mailNotificationsEnabled value. + */ + public Boolean mailNotificationsEnabled() { + return this.mailNotificationsEnabled; + } + + /** + * Set the mailNotificationsEnabled property: Flag to indicate whether sending mails to reviewers and the review + * creator is enabled. + * + * @param mailNotificationsEnabled the mailNotificationsEnabled value to set. + * @return the AccessReviewScheduleSettings object itself. + */ + public AccessReviewScheduleSettings withMailNotificationsEnabled(Boolean mailNotificationsEnabled) { + this.mailNotificationsEnabled = mailNotificationsEnabled; + return this; + } + + /** + * Get the reminderNotificationsEnabled property: Flag to indicate whether sending reminder emails to reviewers are + * enabled. + * + * @return the reminderNotificationsEnabled value. + */ + public Boolean reminderNotificationsEnabled() { + return this.reminderNotificationsEnabled; + } + + /** + * Set the reminderNotificationsEnabled property: Flag to indicate whether sending reminder emails to reviewers are + * enabled. + * + * @param reminderNotificationsEnabled the reminderNotificationsEnabled value to set. + * @return the AccessReviewScheduleSettings object itself. + */ + public AccessReviewScheduleSettings withReminderNotificationsEnabled(Boolean reminderNotificationsEnabled) { + this.reminderNotificationsEnabled = reminderNotificationsEnabled; + return this; + } + + /** + * Get the defaultDecisionEnabled property: Flag to indicate whether reviewers are required to provide a + * justification when reviewing access. + * + * @return the defaultDecisionEnabled value. + */ + public Boolean defaultDecisionEnabled() { + return this.defaultDecisionEnabled; + } + + /** + * Set the defaultDecisionEnabled property: Flag to indicate whether reviewers are required to provide a + * justification when reviewing access. + * + * @param defaultDecisionEnabled the defaultDecisionEnabled value to set. + * @return the AccessReviewScheduleSettings object itself. + */ + public AccessReviewScheduleSettings withDefaultDecisionEnabled(Boolean defaultDecisionEnabled) { + this.defaultDecisionEnabled = defaultDecisionEnabled; + return this; + } + + /** + * Get the justificationRequiredOnApproval property: Flag to indicate whether the reviewer is required to pass + * justification when recording a decision. + * + * @return the justificationRequiredOnApproval value. + */ + public Boolean justificationRequiredOnApproval() { + return this.justificationRequiredOnApproval; + } + + /** + * Set the justificationRequiredOnApproval property: Flag to indicate whether the reviewer is required to pass + * justification when recording a decision. + * + * @param justificationRequiredOnApproval the justificationRequiredOnApproval value to set. + * @return the AccessReviewScheduleSettings object itself. + */ + public AccessReviewScheduleSettings withJustificationRequiredOnApproval(Boolean justificationRequiredOnApproval) { + this.justificationRequiredOnApproval = justificationRequiredOnApproval; + return this; + } + + /** + * Get the defaultDecision property: This specifies the behavior for the autoReview feature when an access review + * completes. + * + * @return the defaultDecision value. + */ + public DefaultDecisionType defaultDecision() { + return this.defaultDecision; + } + + /** + * Set the defaultDecision property: This specifies the behavior for the autoReview feature when an access review + * completes. + * + * @param defaultDecision the defaultDecision value to set. + * @return the AccessReviewScheduleSettings object itself. + */ + public AccessReviewScheduleSettings withDefaultDecision(DefaultDecisionType defaultDecision) { + this.defaultDecision = defaultDecision; + return this; + } + + /** + * Get the autoApplyDecisionsEnabled property: 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. + * + * @return the autoApplyDecisionsEnabled value. + */ + public Boolean autoApplyDecisionsEnabled() { + return this.autoApplyDecisionsEnabled; + } + + /** + * Set the autoApplyDecisionsEnabled property: 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. + * + * @param autoApplyDecisionsEnabled the autoApplyDecisionsEnabled value to set. + * @return the AccessReviewScheduleSettings object itself. + */ + public AccessReviewScheduleSettings withAutoApplyDecisionsEnabled(Boolean autoApplyDecisionsEnabled) { + this.autoApplyDecisionsEnabled = autoApplyDecisionsEnabled; + return this; + } + + /** + * Get the recommendationsEnabled property: Flag to indicate whether showing recommendations to reviewers is + * enabled. + * + * @return the recommendationsEnabled value. + */ + public Boolean recommendationsEnabled() { + return this.recommendationsEnabled; + } + + /** + * Set the recommendationsEnabled property: Flag to indicate whether showing recommendations to reviewers is + * enabled. + * + * @param recommendationsEnabled the recommendationsEnabled value to set. + * @return the AccessReviewScheduleSettings object itself. + */ + public AccessReviewScheduleSettings withRecommendationsEnabled(Boolean recommendationsEnabled) { + this.recommendationsEnabled = recommendationsEnabled; + return this; + } + + /** + * Get the recommendationLookBackDuration property: 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)). + * + * @return the recommendationLookBackDuration value. + */ + public Duration recommendationLookBackDuration() { + return this.recommendationLookBackDuration; + } + + /** + * Set the recommendationLookBackDuration property: 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)). + * + * @param recommendationLookBackDuration the recommendationLookBackDuration value to set. + * @return the AccessReviewScheduleSettings object itself. + */ + public AccessReviewScheduleSettings withRecommendationLookBackDuration(Duration recommendationLookBackDuration) { + this.recommendationLookBackDuration = recommendationLookBackDuration; + return this; + } + + /** + * Get the instanceDurationInDays property: The duration in days for an instance. + * + * @return the instanceDurationInDays value. + */ + public Integer instanceDurationInDays() { + return this.instanceDurationInDays; + } + + /** + * Set the instanceDurationInDays property: The duration in days for an instance. + * + * @param instanceDurationInDays the instanceDurationInDays value to set. + * @return the AccessReviewScheduleSettings object itself. + */ + public AccessReviewScheduleSettings withInstanceDurationInDays(Integer instanceDurationInDays) { + this.instanceDurationInDays = instanceDurationInDays; + return this; + } + + /** + * Get the innerRecurrence property: Access Review Settings. + * + * @return the innerRecurrence value. + */ + private AccessReviewRecurrenceSettings innerRecurrence() { + return this.innerRecurrence; + } + + /** + * Get the type property: The recurrence type : weekly, monthly, etc. + * + * @return the type value. + */ + public AccessReviewRecurrencePatternType type() { + return this.innerRecurrence() == null ? null : this.innerRecurrence().type(); + } + + /** + * Set the type property: The recurrence type : weekly, monthly, etc. + * + * @param type the type value to set. + * @return the AccessReviewScheduleSettings object itself. + */ + public AccessReviewScheduleSettings withType(AccessReviewRecurrencePatternType type) { + if (this.innerRecurrence() == null) { + this.innerRecurrence = new AccessReviewRecurrenceSettings(); + } + this.innerRecurrence().withType(type); + return this; + } + + /** + * Get the interval property: The interval for recurrence. For a quarterly review, the interval is 3 for type : + * absoluteMonthly. + * + * @return the interval value. + */ + public Integer interval() { + return this.innerRecurrence() == null ? null : this.innerRecurrence().interval(); + } + + /** + * Set the interval property: The interval for recurrence. For a quarterly review, the interval is 3 for type : + * absoluteMonthly. + * + * @param interval the interval value to set. + * @return the AccessReviewScheduleSettings object itself. + */ + public AccessReviewScheduleSettings withInterval(Integer interval) { + if (this.innerRecurrence() == null) { + this.innerRecurrence = new AccessReviewRecurrenceSettings(); + } + this.innerRecurrence().withInterval(interval); + return this; + } + + /** + * Get the typeRangeType property: The recurrence range type. The possible values are: endDate, noEnd, numbered. + * + * @return the typeRangeType value. + */ + public AccessReviewRecurrenceRangeType typeRangeType() { + return this.innerRecurrence() == null ? null : this.innerRecurrence().typeRangeType(); + } + + /** + * Set the typeRangeType property: The recurrence range type. The possible values are: endDate, noEnd, numbered. + * + * @param typeRangeType the typeRangeType value to set. + * @return the AccessReviewScheduleSettings object itself. + */ + public AccessReviewScheduleSettings withTypeRangeType(AccessReviewRecurrenceRangeType typeRangeType) { + if (this.innerRecurrence() == null) { + this.innerRecurrence = new AccessReviewRecurrenceSettings(); + } + this.innerRecurrence().withTypeRangeType(typeRangeType); + return this; + } + + /** + * Get the numberOfOccurrences property: The number of times to repeat the access review. Required and must be + * positive if type is numbered. + * + * @return the numberOfOccurrences value. + */ + public Integer numberOfOccurrences() { + return this.innerRecurrence() == null ? null : this.innerRecurrence().numberOfOccurrences(); + } + + /** + * Set the numberOfOccurrences property: The number of times to repeat the access review. Required and must be + * positive if type is numbered. + * + * @param numberOfOccurrences the numberOfOccurrences value to set. + * @return the AccessReviewScheduleSettings object itself. + */ + public AccessReviewScheduleSettings withNumberOfOccurrences(Integer numberOfOccurrences) { + if (this.innerRecurrence() == null) { + this.innerRecurrence = new AccessReviewRecurrenceSettings(); + } + this.innerRecurrence().withNumberOfOccurrences(numberOfOccurrences); + return this; + } + + /** + * Get the startDate property: The DateTime when the review is scheduled to be start. This could be a date in the + * future. Required on create. + * + * @return the startDate value. + */ + public OffsetDateTime startDate() { + return this.innerRecurrence() == null ? null : this.innerRecurrence().startDate(); + } + + /** + * Set the startDate property: The DateTime when the review is scheduled to be start. This could be a date in the + * future. Required on create. + * + * @param startDate the startDate value to set. + * @return the AccessReviewScheduleSettings object itself. + */ + public AccessReviewScheduleSettings withStartDate(OffsetDateTime startDate) { + if (this.innerRecurrence() == null) { + this.innerRecurrence = new AccessReviewRecurrenceSettings(); + } + this.innerRecurrence().withStartDate(startDate); + return this; + } + + /** + * Get the endDate property: The DateTime when the review is scheduled to end. Required if type is endDate. + * + * @return the endDate value. + */ + public OffsetDateTime endDate() { + return this.innerRecurrence() == null ? null : this.innerRecurrence().endDate(); + } + + /** + * Set the endDate property: The DateTime when the review is scheduled to end. Required if type is endDate. + * + * @param endDate the endDate value to set. + * @return the AccessReviewScheduleSettings object itself. + */ + public AccessReviewScheduleSettings withEndDate(OffsetDateTime endDate) { + if (this.innerRecurrence() == null) { + this.innerRecurrence = new AccessReviewRecurrenceSettings(); + } + this.innerRecurrence().withEndDate(endDate); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerRecurrence() != null) { + innerRecurrence().validate(); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewScope.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewScope.java new file mode 100644 index 0000000000000..ed305d8fb2222 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewScope.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewScopeAssignmentState; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewScopePrincipalType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; + +/** Descriptor for what needs to be reviewed. */ +@Fluent +public final class AccessReviewScope { + /* + * ResourceId in which this review is getting created + */ + @JsonProperty(value = "resourceId", access = JsonProperty.Access.WRITE_ONLY) + private String resourceId; + + /* + * This is used to indicate the role being reviewed + */ + @JsonProperty(value = "roleDefinitionId", access = JsonProperty.Access.WRITE_ONLY) + private String roleDefinitionId; + + /* + * The identity type user/servicePrincipal to review + */ + @JsonProperty(value = "principalType", access = JsonProperty.Access.WRITE_ONLY) + private AccessReviewScopePrincipalType principalType; + + /* + * The role assignment state eligible/active to review + */ + @JsonProperty(value = "assignmentState", access = JsonProperty.Access.WRITE_ONLY) + private AccessReviewScopeAssignmentState assignmentState; + + /* + * 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)) + */ + @JsonProperty(value = "inactiveDuration") + private Duration inactiveDuration; + + /* + * Flag to indicate whether to expand nested memberships or not. + */ + @JsonProperty(value = "expandNestedMemberships") + private Boolean expandNestedMemberships; + + /* + * Flag to indicate whether to expand nested memberships or not. + */ + @JsonProperty(value = "includeInheritedAccess") + private Boolean includeInheritedAccess; + + /* + * Flag to indicate whether to expand nested memberships or not. + */ + @JsonProperty(value = "includeAccessBelowResource") + private Boolean includeAccessBelowResource; + + /* + * This is used to indicate the resource id(s) to exclude + */ + @JsonProperty(value = "excludeResourceId") + private String excludeResourceId; + + /* + * This is used to indicate the role definition id(s) to exclude + */ + @JsonProperty(value = "excludeRoleDefinitionId") + private String excludeRoleDefinitionId; + + /** + * Get the resourceId property: ResourceId in which this review is getting created. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Get the roleDefinitionId property: This is used to indicate the role being reviewed. + * + * @return the roleDefinitionId value. + */ + public String roleDefinitionId() { + return this.roleDefinitionId; + } + + /** + * Get the principalType property: The identity type user/servicePrincipal to review. + * + * @return the principalType value. + */ + public AccessReviewScopePrincipalType principalType() { + return this.principalType; + } + + /** + * Get the assignmentState property: The role assignment state eligible/active to review. + * + * @return the assignmentState value. + */ + public AccessReviewScopeAssignmentState assignmentState() { + return this.assignmentState; + } + + /** + * Get the inactiveDuration property: 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)). + * + * @return the inactiveDuration value. + */ + public Duration inactiveDuration() { + return this.inactiveDuration; + } + + /** + * Set the inactiveDuration property: 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)). + * + * @param inactiveDuration the inactiveDuration value to set. + * @return the AccessReviewScope object itself. + */ + public AccessReviewScope withInactiveDuration(Duration inactiveDuration) { + this.inactiveDuration = inactiveDuration; + return this; + } + + /** + * Get the expandNestedMemberships property: Flag to indicate whether to expand nested memberships or not. + * + * @return the expandNestedMemberships value. + */ + public Boolean expandNestedMemberships() { + return this.expandNestedMemberships; + } + + /** + * Set the expandNestedMemberships property: Flag to indicate whether to expand nested memberships or not. + * + * @param expandNestedMemberships the expandNestedMemberships value to set. + * @return the AccessReviewScope object itself. + */ + public AccessReviewScope withExpandNestedMemberships(Boolean expandNestedMemberships) { + this.expandNestedMemberships = expandNestedMemberships; + return this; + } + + /** + * Get the includeInheritedAccess property: Flag to indicate whether to expand nested memberships or not. + * + * @return the includeInheritedAccess value. + */ + public Boolean includeInheritedAccess() { + return this.includeInheritedAccess; + } + + /** + * Set the includeInheritedAccess property: Flag to indicate whether to expand nested memberships or not. + * + * @param includeInheritedAccess the includeInheritedAccess value to set. + * @return the AccessReviewScope object itself. + */ + public AccessReviewScope withIncludeInheritedAccess(Boolean includeInheritedAccess) { + this.includeInheritedAccess = includeInheritedAccess; + return this; + } + + /** + * Get the includeAccessBelowResource property: Flag to indicate whether to expand nested memberships or not. + * + * @return the includeAccessBelowResource value. + */ + public Boolean includeAccessBelowResource() { + return this.includeAccessBelowResource; + } + + /** + * Set the includeAccessBelowResource property: Flag to indicate whether to expand nested memberships or not. + * + * @param includeAccessBelowResource the includeAccessBelowResource value to set. + * @return the AccessReviewScope object itself. + */ + public AccessReviewScope withIncludeAccessBelowResource(Boolean includeAccessBelowResource) { + this.includeAccessBelowResource = includeAccessBelowResource; + return this; + } + + /** + * Get the excludeResourceId property: This is used to indicate the resource id(s) to exclude. + * + * @return the excludeResourceId value. + */ + public String excludeResourceId() { + return this.excludeResourceId; + } + + /** + * Set the excludeResourceId property: This is used to indicate the resource id(s) to exclude. + * + * @param excludeResourceId the excludeResourceId value to set. + * @return the AccessReviewScope object itself. + */ + public AccessReviewScope withExcludeResourceId(String excludeResourceId) { + this.excludeResourceId = excludeResourceId; + return this; + } + + /** + * Get the excludeRoleDefinitionId property: This is used to indicate the role definition id(s) to exclude. + * + * @return the excludeRoleDefinitionId value. + */ + public String excludeRoleDefinitionId() { + return this.excludeRoleDefinitionId; + } + + /** + * Set the excludeRoleDefinitionId property: This is used to indicate the role definition id(s) to exclude. + * + * @param excludeRoleDefinitionId the excludeRoleDefinitionId value to set. + * @return the AccessReviewScope object itself. + */ + public AccessReviewScope withExcludeRoleDefinitionId(String excludeRoleDefinitionId) { + this.excludeRoleDefinitionId = excludeRoleDefinitionId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/OperationInner.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/OperationInner.java new file mode 100644 index 0000000000000..22b440910482b --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/OperationInner.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.authorization.generated.models.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The definition of a Microsoft.Authorization operation. */ +@Fluent +public final class OperationInner { + /* + * Name of the operation + */ + @JsonProperty(value = "name") + private String name; + + /* + * Indicates whether the operation is a data action + */ + @JsonProperty(value = "isDataAction") + private Boolean isDataAction; + + /* + * Display of the operation + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /* + * Origin of the operation + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * Get the name property: Name of the operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the operation. + * + * @param name the name value to set. + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the isDataAction property: Indicates whether the operation is a data action. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set the isDataAction property: Indicates whether the operation is a data action. + * + * @param isDataAction the isDataAction value to set. + * @return the OperationInner object itself. + */ + public OperationInner withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + + /** + * Get the display property: Display of the operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Display of the operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: Origin of the operation. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin property: Origin of the operation. + * + * @param origin the origin value to set. + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/package-info.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/package-info.java new file mode 100644 index 0000000000000..778f02ae93c82 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the inner data models for AuthorizationManagementClient. Access reviews service provides the + * workflow for running access reviews on different kind of resources. + */ +package com.azure.resourcemanager.authorization.generated.fluent.models; diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/package-info.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/package-info.java new file mode 100644 index 0000000000000..e4a5da680dfa8 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the service clients for AuthorizationManagementClient. Access reviews service provides the + * workflow for running access reviews on different kind of resources. + */ +package com.azure.resourcemanager.authorization.generated.fluent; diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewContactedReviewerImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewContactedReviewerImpl.java new file mode 100644 index 0000000000000..f4b623dbe7a3c --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewContactedReviewerImpl.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewContactedReviewerInner; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewContactedReviewer; +import java.time.OffsetDateTime; + +public final class AccessReviewContactedReviewerImpl implements AccessReviewContactedReviewer { + private AccessReviewContactedReviewerInner innerObject; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + AccessReviewContactedReviewerImpl( + AccessReviewContactedReviewerInner innerObject, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String userDisplayName() { + return this.innerModel().userDisplayName(); + } + + public String userPrincipalName() { + return this.innerModel().userPrincipalName(); + } + + public OffsetDateTime createdDateTime() { + return this.innerModel().createdDateTime(); + } + + public AccessReviewContactedReviewerInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewDecisionImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewDecisionImpl.java new file mode 100644 index 0000000000000..80ae4ade9d737 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewDecisionImpl.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewDecisionInner; +import com.azure.resourcemanager.authorization.generated.models.AccessRecommendationType; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewActorIdentityType; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewApplyResult; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewDecision; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewDecisionInsight; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewDecisionPrincipalResourceMembershipType; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewResult; +import com.azure.resourcemanager.authorization.generated.models.DecisionResourceType; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class AccessReviewDecisionImpl implements AccessReviewDecision { + private AccessReviewDecisionInner innerObject; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + AccessReviewDecisionImpl( + AccessReviewDecisionInner innerObject, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public AccessRecommendationType recommendation() { + return this.innerModel().recommendation(); + } + + public AccessReviewResult decision() { + return this.innerModel().decision(); + } + + public String justification() { + return this.innerModel().justification(); + } + + public OffsetDateTime reviewedDateTime() { + return this.innerModel().reviewedDateTime(); + } + + public AccessReviewApplyResult applyResult() { + return this.innerModel().applyResult(); + } + + public OffsetDateTime appliedDateTime() { + return this.innerModel().appliedDateTime(); + } + + public List insights() { + List inner = this.innerModel().insights(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String idPropertiesId() { + return this.innerModel().idPropertiesId(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public DecisionResourceType typePropertiesType() { + return this.innerModel().typePropertiesType(); + } + + public String idResourceId() { + return this.innerModel().idResourceId(); + } + + public String displayNameResourceDisplayName() { + return this.innerModel().displayNameResourceDisplayName(); + } + + public String principalId() { + return this.innerModel().principalId(); + } + + public AccessReviewActorIdentityType principalType() { + return this.innerModel().principalType(); + } + + public String principalName() { + return this.innerModel().principalName(); + } + + public String userPrincipalName() { + return this.innerModel().userPrincipalName(); + } + + public String principalIdAppliedByPrincipalId() { + return this.innerModel().principalIdAppliedByPrincipalId(); + } + + public AccessReviewActorIdentityType principalTypeAppliedByPrincipalType() { + return this.innerModel().principalTypeAppliedByPrincipalType(); + } + + public String principalNameAppliedByPrincipalName() { + return this.innerModel().principalNameAppliedByPrincipalName(); + } + + public String userPrincipalNameAppliedByUserPrincipalName() { + return this.innerModel().userPrincipalNameAppliedByUserPrincipalName(); + } + + public List membershipTypes() { + List inner = this.innerModel().membershipTypes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public AccessReviewDecisionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewDefaultSettingsImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewDefaultSettingsImpl.java new file mode 100644 index 0000000000000..fa4e23360395e --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewDefaultSettingsImpl.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewDefaultSettingsInner; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewDefaultSettings; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewRecurrencePatternType; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewRecurrenceRangeType; +import com.azure.resourcemanager.authorization.generated.models.DefaultDecisionType; +import java.time.Duration; +import java.time.OffsetDateTime; + +public final class AccessReviewDefaultSettingsImpl implements AccessReviewDefaultSettings { + private AccessReviewDefaultSettingsInner innerObject; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + AccessReviewDefaultSettingsImpl( + AccessReviewDefaultSettingsInner innerObject, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public Boolean mailNotificationsEnabled() { + return this.innerModel().mailNotificationsEnabled(); + } + + public Boolean reminderNotificationsEnabled() { + return this.innerModel().reminderNotificationsEnabled(); + } + + public Boolean defaultDecisionEnabled() { + return this.innerModel().defaultDecisionEnabled(); + } + + public Boolean justificationRequiredOnApproval() { + return this.innerModel().justificationRequiredOnApproval(); + } + + public DefaultDecisionType defaultDecision() { + return this.innerModel().defaultDecision(); + } + + public Boolean autoApplyDecisionsEnabled() { + return this.innerModel().autoApplyDecisionsEnabled(); + } + + public Boolean recommendationsEnabled() { + return this.innerModel().recommendationsEnabled(); + } + + public Duration recommendationLookBackDuration() { + return this.innerModel().recommendationLookBackDuration(); + } + + public Integer instanceDurationInDays() { + return this.innerModel().instanceDurationInDays(); + } + + public AccessReviewRecurrencePatternType typePropertiesType() { + return this.innerModel().typePropertiesType(); + } + + public Integer interval() { + return this.innerModel().interval(); + } + + public AccessReviewRecurrenceRangeType typeRangeType() { + return this.innerModel().typeRangeType(); + } + + public Integer numberOfOccurrences() { + return this.innerModel().numberOfOccurrences(); + } + + public OffsetDateTime startDate() { + return this.innerModel().startDate(); + } + + public OffsetDateTime endDate() { + return this.innerModel().endDate(); + } + + public AccessReviewDefaultSettingsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewDefaultSettingsOperationsClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewDefaultSettingsOperationsClientImpl.java new file mode 100644 index 0000000000000..cc71e4e370259 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewDefaultSettingsOperationsClientImpl.java @@ -0,0 +1,329 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.authorization.generated.fluent.AccessReviewDefaultSettingsOperationsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewDefaultSettingsInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewScheduleSettings; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * AccessReviewDefaultSettingsOperationsClient. + */ +public final class AccessReviewDefaultSettingsOperationsClientImpl + implements AccessReviewDefaultSettingsOperationsClient { + /** The proxy service used to perform REST calls. */ + private final AccessReviewDefaultSettingsOperationsService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of AccessReviewDefaultSettingsOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AccessReviewDefaultSettingsOperationsClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy + .create( + AccessReviewDefaultSettingsOperationsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AuthorizationManagementClientAccessReviewDefaultSettingsOperations to + * be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + private interface AccessReviewDefaultSettingsOperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleSettings/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleSettings/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> put( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AccessReviewScheduleSettings properties, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get access review default settings for the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review default settings for the subscription along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get access review default settings for the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review default settings for the subscription along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get access review default settings for the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review default settings for the subscription on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync() { + return getWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get access review default settings for the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review default settings for the subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessReviewDefaultSettingsInner get() { + return getAsync().block(); + } + + /** + * Get access review default settings for the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review default settings for the subscription along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(Context context) { + return getWithResponseAsync(context).block(); + } + + /** + * Get access review default settings for the subscription. + * + * @param properties Access review schedule settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review default settings for the subscription along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putWithResponseAsync( + AccessReviewScheduleSettings properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .put( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + properties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get access review default settings for the subscription. + * + * @param properties Access review schedule settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review default settings for the subscription along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putWithResponseAsync( + AccessReviewScheduleSettings properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .put( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + properties, + accept, + context); + } + + /** + * Get access review default settings for the subscription. + * + * @param properties Access review schedule settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review default settings for the subscription on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putAsync(AccessReviewScheduleSettings properties) { + return putWithResponseAsync(properties).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get access review default settings for the subscription. + * + * @param properties Access review schedule settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review default settings for the subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessReviewDefaultSettingsInner put(AccessReviewScheduleSettings properties) { + return putAsync(properties).block(); + } + + /** + * Get access review default settings for the subscription. + * + * @param properties Access review schedule settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review default settings for the subscription along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse( + AccessReviewScheduleSettings properties, Context context) { + return putWithResponseAsync(properties, context).block(); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewDefaultSettingsOperationsImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewDefaultSettingsOperationsImpl.java new file mode 100644 index 0000000000000..6db5ffb3ab00c --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewDefaultSettingsOperationsImpl.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.authorization.generated.fluent.AccessReviewDefaultSettingsOperationsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewDefaultSettingsInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewScheduleSettings; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewDefaultSettings; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewDefaultSettingsOperations; + +public final class AccessReviewDefaultSettingsOperationsImpl implements AccessReviewDefaultSettingsOperations { + private static final ClientLogger LOGGER = new ClientLogger(AccessReviewDefaultSettingsOperationsImpl.class); + + private final AccessReviewDefaultSettingsOperationsClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public AccessReviewDefaultSettingsOperationsImpl( + AccessReviewDefaultSettingsOperationsClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public AccessReviewDefaultSettings get() { + AccessReviewDefaultSettingsInner inner = this.serviceClient().get(); + if (inner != null) { + return new AccessReviewDefaultSettingsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(Context context) { + Response inner = this.serviceClient().getWithResponse(context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AccessReviewDefaultSettingsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AccessReviewDefaultSettings put(AccessReviewScheduleSettings properties) { + AccessReviewDefaultSettingsInner inner = this.serviceClient().put(properties); + if (inner != null) { + return new AccessReviewDefaultSettingsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response putWithResponse( + AccessReviewScheduleSettings properties, Context context) { + Response inner = this.serviceClient().putWithResponse(properties, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AccessReviewDefaultSettingsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private AccessReviewDefaultSettingsOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionImpl.java new file mode 100644 index 0000000000000..d9e1f493b9cf7 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionImpl.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryDefinitionInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryDefinitionProperties; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryInstanceInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewScope; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewActorIdentityType; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewHistoryDefinition; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewHistoryDefinitionStatus; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewHistoryInstance; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewRecurrencePatternType; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewRecurrenceRangeType; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewResult; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class AccessReviewHistoryDefinitionImpl + implements AccessReviewHistoryDefinition, AccessReviewHistoryDefinition.Definition { + private AccessReviewHistoryDefinitionInner innerObject; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + AccessReviewHistoryDefinitionImpl( + AccessReviewHistoryDefinitionInner innerObject, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public OffsetDateTime reviewHistoryPeriodStartDateTime() { + return this.innerModel().reviewHistoryPeriodStartDateTime(); + } + + public OffsetDateTime reviewHistoryPeriodEndDateTime() { + return this.innerModel().reviewHistoryPeriodEndDateTime(); + } + + public List decisions() { + List inner = this.innerModel().decisions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public AccessReviewHistoryDefinitionStatus status() { + return this.innerModel().status(); + } + + public OffsetDateTime createdDateTime() { + return this.innerModel().createdDateTime(); + } + + public List scopes() { + List inner = this.innerModel().scopes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List instances() { + List inner = this.innerModel().instances(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new AccessReviewHistoryInstanceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String principalId() { + return this.innerModel().principalId(); + } + + public AccessReviewActorIdentityType principalType() { + return this.innerModel().principalType(); + } + + public String principalName() { + return this.innerModel().principalName(); + } + + public String userPrincipalName() { + return this.innerModel().userPrincipalName(); + } + + public AccessReviewRecurrencePatternType typePropertiesType() { + return this.innerModel().typePropertiesType(); + } + + public Integer interval() { + return this.innerModel().interval(); + } + + public AccessReviewRecurrenceRangeType typeRangeType() { + return this.innerModel().typeRangeType(); + } + + public Integer numberOfOccurrences() { + return this.innerModel().numberOfOccurrences(); + } + + public OffsetDateTime startDate() { + return this.innerModel().startDate(); + } + + public OffsetDateTime endDate() { + return this.innerModel().endDate(); + } + + public AccessReviewHistoryDefinitionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } + + private String historyDefinitionId; + + private AccessReviewHistoryDefinitionProperties createProperties; + + public AccessReviewHistoryDefinition create() { + this.innerObject = + serviceManager + .serviceClient() + .getAccessReviewHistoryDefinitionOperations() + .createWithResponse(historyDefinitionId, createProperties, Context.NONE) + .getValue(); + return this; + } + + public AccessReviewHistoryDefinition create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAccessReviewHistoryDefinitionOperations() + .createWithResponse(historyDefinitionId, createProperties, context) + .getValue(); + return this; + } + + AccessReviewHistoryDefinitionImpl( + String name, com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerObject = new AccessReviewHistoryDefinitionInner(); + this.serviceManager = serviceManager; + this.historyDefinitionId = name; + this.createProperties = new AccessReviewHistoryDefinitionProperties(); + } + + public AccessReviewHistoryDefinitionImpl withDisplayName(String displayName) { + this.createProperties.withDisplayName(displayName); + return this; + } + + public AccessReviewHistoryDefinitionImpl withDecisions(List decisions) { + this.createProperties.withDecisions(decisions); + return this; + } + + public AccessReviewHistoryDefinitionImpl withScopes(List scopes) { + this.createProperties.withScopes(scopes); + return this; + } + + public AccessReviewHistoryDefinitionImpl withInstances(List instances) { + this.createProperties.withInstances(instances); + return this; + } + + public AccessReviewHistoryDefinitionImpl withType(AccessReviewRecurrencePatternType type) { + this.createProperties.withType(type); + return this; + } + + public AccessReviewHistoryDefinitionImpl withInterval(Integer interval) { + this.createProperties.withInterval(interval); + return this; + } + + public AccessReviewHistoryDefinitionImpl withTypeRangeType(AccessReviewRecurrenceRangeType typeRangeType) { + this.createProperties.withTypeRangeType(typeRangeType); + return this; + } + + public AccessReviewHistoryDefinitionImpl withNumberOfOccurrences(Integer numberOfOccurrences) { + this.createProperties.withNumberOfOccurrences(numberOfOccurrences); + return this; + } + + public AccessReviewHistoryDefinitionImpl withStartDate(OffsetDateTime startDate) { + this.createProperties.withStartDate(startDate); + return this; + } + + public AccessReviewHistoryDefinitionImpl withEndDate(OffsetDateTime endDate) { + this.createProperties.withEndDate(endDate); + return this; + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionInstancesClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionInstancesClientImpl.java new file mode 100644 index 0000000000000..090406398848e --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionInstancesClientImpl.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.authorization.generated.fluent.AccessReviewHistoryDefinitionInstancesClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryInstanceInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * AccessReviewHistoryDefinitionInstancesClient. + */ +public final class AccessReviewHistoryDefinitionInstancesClientImpl + implements AccessReviewHistoryDefinitionInstancesClient { + /** The proxy service used to perform REST calls. */ + private final AccessReviewHistoryDefinitionInstancesService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of AccessReviewHistoryDefinitionInstancesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AccessReviewHistoryDefinitionInstancesClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy + .create( + AccessReviewHistoryDefinitionInstancesService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AuthorizationManagementClientAccessReviewHistoryDefinitionInstances + * to be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + private interface AccessReviewHistoryDefinitionInstancesService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewHistoryDefinitions" + + "/{historyDefinitionId}/instances/{instanceId}/generateDownloadUri") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> generateDownloadUri( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("historyDefinitionId") String historyDefinitionId, + @PathParam("instanceId") String instanceId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review History Definition Instance along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> generateDownloadUriWithResponseAsync( + String historyDefinitionId, String instanceId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (historyDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter historyDefinitionId is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .generateDownloadUri( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + historyDefinitionId, + instanceId, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review History Definition Instance along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> generateDownloadUriWithResponseAsync( + String historyDefinitionId, String instanceId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (historyDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter historyDefinitionId is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .generateDownloadUri( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + historyDefinitionId, + instanceId, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review History Definition Instance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generateDownloadUriAsync( + String historyDefinitionId, String instanceId) { + return generateDownloadUriWithResponseAsync(historyDefinitionId, instanceId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review History Definition Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessReviewHistoryInstanceInner generateDownloadUri(String historyDefinitionId, String instanceId) { + return generateDownloadUriAsync(historyDefinitionId, instanceId).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review History Definition Instance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response generateDownloadUriWithResponse( + String historyDefinitionId, String instanceId, Context context) { + return generateDownloadUriWithResponseAsync(historyDefinitionId, instanceId, context).block(); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionInstancesImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionInstancesImpl.java new file mode 100644 index 0000000000000..b277699bf63de --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionInstancesImpl.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.authorization.generated.fluent.AccessReviewHistoryDefinitionInstancesClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryInstanceInner; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewHistoryDefinitionInstances; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewHistoryInstance; + +public final class AccessReviewHistoryDefinitionInstancesImpl implements AccessReviewHistoryDefinitionInstances { + private static final ClientLogger LOGGER = new ClientLogger(AccessReviewHistoryDefinitionInstancesImpl.class); + + private final AccessReviewHistoryDefinitionInstancesClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public AccessReviewHistoryDefinitionInstancesImpl( + AccessReviewHistoryDefinitionInstancesClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public AccessReviewHistoryInstance generateDownloadUri(String historyDefinitionId, String instanceId) { + AccessReviewHistoryInstanceInner inner = + this.serviceClient().generateDownloadUri(historyDefinitionId, instanceId); + if (inner != null) { + return new AccessReviewHistoryInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response generateDownloadUriWithResponse( + String historyDefinitionId, String instanceId, Context context) { + Response inner = + this.serviceClient().generateDownloadUriWithResponse(historyDefinitionId, instanceId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AccessReviewHistoryInstanceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private AccessReviewHistoryDefinitionInstancesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionInstancesOperationsClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionInstancesOperationsClientImpl.java new file mode 100644 index 0000000000000..ce5aba970ad4d --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionInstancesOperationsClientImpl.java @@ -0,0 +1,334 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.authorization.generated.fluent.AccessReviewHistoryDefinitionInstancesOperationsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryInstanceInner; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewHistoryDefinitionInstanceListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * AccessReviewHistoryDefinitionInstancesOperationsClient. + */ +public final class AccessReviewHistoryDefinitionInstancesOperationsClientImpl + implements AccessReviewHistoryDefinitionInstancesOperationsClient { + /** The proxy service used to perform REST calls. */ + private final AccessReviewHistoryDefinitionInstancesOperationsService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of AccessReviewHistoryDefinitionInstancesOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AccessReviewHistoryDefinitionInstancesOperationsClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy + .create( + AccessReviewHistoryDefinitionInstancesOperationsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * AuthorizationManagementClientAccessReviewHistoryDefinitionInstancesOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + private interface AccessReviewHistoryDefinitionInstancesOperationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewHistoryDefinitions" + + "/{historyDefinitionId}/instances") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("historyDefinitionId") String historyDefinitionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get access review history definition instances by definition Id. + * + * @param historyDefinitionId The id of the access review history definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review history definition instances by definition Id along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String historyDefinitionId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (historyDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter historyDefinitionId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + historyDefinitionId, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get access review history definition instances by definition Id. + * + * @param historyDefinitionId The id of the access review history definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review history definition instances by definition Id along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String historyDefinitionId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (historyDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter historyDefinitionId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + historyDefinitionId, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get access review history definition instances by definition Id. + * + * @param historyDefinitionId The id of the access review history definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review history definition instances by definition Id as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String historyDefinitionId) { + return new PagedFlux<>( + () -> listSinglePageAsync(historyDefinitionId), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get access review history definition instances by definition Id. + * + * @param historyDefinitionId The id of the access review history definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review history definition instances by definition Id as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String historyDefinitionId, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(historyDefinitionId, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get access review history definition instances by definition Id. + * + * @param historyDefinitionId The id of the access review history definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review history definition instances by definition Id as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String historyDefinitionId) { + return new PagedIterable<>(listAsync(historyDefinitionId)); + } + + /** + * Get access review history definition instances by definition Id. + * + * @param historyDefinitionId The id of the access review history definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review history definition instances by definition Id as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String historyDefinitionId, Context context) { + return new PagedIterable<>(listAsync(historyDefinitionId, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review History Instances along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review History Instances along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionInstancesOperationsImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionInstancesOperationsImpl.java new file mode 100644 index 0000000000000..cbf1260caa6e8 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionInstancesOperationsImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.authorization.generated.fluent.AccessReviewHistoryDefinitionInstancesOperationsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryInstanceInner; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewHistoryDefinitionInstancesOperations; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewHistoryInstance; + +public final class AccessReviewHistoryDefinitionInstancesOperationsImpl + implements AccessReviewHistoryDefinitionInstancesOperations { + private static final ClientLogger LOGGER = + new ClientLogger(AccessReviewHistoryDefinitionInstancesOperationsImpl.class); + + private final AccessReviewHistoryDefinitionInstancesOperationsClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public AccessReviewHistoryDefinitionInstancesOperationsImpl( + AccessReviewHistoryDefinitionInstancesOperationsClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String historyDefinitionId) { + PagedIterable inner = this.serviceClient().list(historyDefinitionId); + return Utils.mapPage(inner, inner1 -> new AccessReviewHistoryInstanceImpl(inner1, this.manager())); + } + + public PagedIterable list(String historyDefinitionId, Context context) { + PagedIterable inner = this.serviceClient().list(historyDefinitionId, context); + return Utils.mapPage(inner, inner1 -> new AccessReviewHistoryInstanceImpl(inner1, this.manager())); + } + + private AccessReviewHistoryDefinitionInstancesOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionOperationsClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionOperationsClientImpl.java new file mode 100644 index 0000000000000..ae3d59d17be3f --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionOperationsClientImpl.java @@ -0,0 +1,366 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.authorization.generated.fluent.AccessReviewHistoryDefinitionOperationsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryDefinitionInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryDefinitionProperties; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * AccessReviewHistoryDefinitionOperationsClient. + */ +public final class AccessReviewHistoryDefinitionOperationsClientImpl + implements AccessReviewHistoryDefinitionOperationsClient { + /** The proxy service used to perform REST calls. */ + private final AccessReviewHistoryDefinitionOperationsService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of AccessReviewHistoryDefinitionOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AccessReviewHistoryDefinitionOperationsClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy + .create( + AccessReviewHistoryDefinitionOperationsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AuthorizationManagementClientAccessReviewHistoryDefinitionOperations + * to be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + private interface AccessReviewHistoryDefinitionOperationsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewHistoryDefinitions" + + "/{historyDefinitionId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("historyDefinitionId") String historyDefinitionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AccessReviewHistoryDefinitionProperties properties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewHistoryDefinitions" + + "/{historyDefinitionId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> deleteById( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("historyDefinitionId") String historyDefinitionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review History Definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String historyDefinitionId, AccessReviewHistoryDefinitionProperties properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (historyDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter historyDefinitionId is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + historyDefinitionId, + this.client.getApiVersion(), + properties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review History Definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String historyDefinitionId, AccessReviewHistoryDefinitionProperties properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (historyDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter historyDefinitionId is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + historyDefinitionId, + this.client.getApiVersion(), + properties, + accept, + context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review History Definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String historyDefinitionId, AccessReviewHistoryDefinitionProperties properties) { + return createWithResponseAsync(historyDefinitionId, properties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review History Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessReviewHistoryDefinitionInner create( + String historyDefinitionId, AccessReviewHistoryDefinitionProperties properties) { + return createAsync(historyDefinitionId, properties).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review History Definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String historyDefinitionId, AccessReviewHistoryDefinitionProperties properties, Context context) { + return createWithResponseAsync(historyDefinitionId, properties, context).block(); + } + + /** + * Delete an access review history definition. + * + * @param historyDefinitionId The id of the access review history definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteByIdWithResponseAsync(String historyDefinitionId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (historyDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter historyDefinitionId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteById( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + historyDefinitionId, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete an access review history definition. + * + * @param historyDefinitionId The id of the access review history definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteByIdWithResponseAsync(String historyDefinitionId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (historyDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter historyDefinitionId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteById( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + historyDefinitionId, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete an access review history definition. + * + * @param historyDefinitionId The id of the access review history definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteByIdAsync(String historyDefinitionId) { + return deleteByIdWithResponseAsync(historyDefinitionId).flatMap(ignored -> Mono.empty()); + } + + /** + * Delete an access review history definition. + * + * @param historyDefinitionId The id of the access review history definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteById(String historyDefinitionId) { + deleteByIdAsync(historyDefinitionId).block(); + } + + /** + * Delete an access review history definition. + * + * @param historyDefinitionId The id of the access review history definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteByIdWithResponse(String historyDefinitionId, Context context) { + return deleteByIdWithResponseAsync(historyDefinitionId, context).block(); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionOperationsImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionOperationsImpl.java new file mode 100644 index 0000000000000..3b14cc02610c8 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionOperationsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.authorization.generated.fluent.AccessReviewHistoryDefinitionOperationsClient; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewHistoryDefinitionOperations; + +public final class AccessReviewHistoryDefinitionOperationsImpl implements AccessReviewHistoryDefinitionOperations { + private static final ClientLogger LOGGER = new ClientLogger(AccessReviewHistoryDefinitionOperationsImpl.class); + + private final AccessReviewHistoryDefinitionOperationsClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public AccessReviewHistoryDefinitionOperationsImpl( + AccessReviewHistoryDefinitionOperationsClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteById(String historyDefinitionId) { + this.serviceClient().deleteById(historyDefinitionId); + } + + public Response deleteByIdWithResponse(String historyDefinitionId, Context context) { + return this.serviceClient().deleteByIdWithResponse(historyDefinitionId, context); + } + + private AccessReviewHistoryDefinitionOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } + + public AccessReviewHistoryDefinitionImpl define(String name) { + return new AccessReviewHistoryDefinitionImpl(name, this.manager()); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionsClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionsClientImpl.java new file mode 100644 index 0000000000000..2b941527745ca --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionsClientImpl.java @@ -0,0 +1,482 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.authorization.generated.fluent.AccessReviewHistoryDefinitionsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryDefinitionInner; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewHistoryDefinitionListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AccessReviewHistoryDefinitionsClient. */ +public final class AccessReviewHistoryDefinitionsClientImpl implements AccessReviewHistoryDefinitionsClient { + /** The proxy service used to perform REST calls. */ + private final AccessReviewHistoryDefinitionsService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of AccessReviewHistoryDefinitionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AccessReviewHistoryDefinitionsClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy + .create( + AccessReviewHistoryDefinitionsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AuthorizationManagementClientAccessReviewHistoryDefinitions to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + private interface AccessReviewHistoryDefinitionsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewHistoryDefinitions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @QueryParam(value = "$filter", encoded = true) String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewHistoryDefinitions" + + "/{historyDefinitionId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getById( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("historyDefinitionId") String historyDefinitionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available + * for 30 days after creation. + * + * @param filter The filter to apply on the operation. Only standard filters on definition name and created date are + * supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review History Definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + filter, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available + * for 30 days after creation. + * + * @param filter The filter to apply on the operation. Only standard filters on definition name and created date are + * supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review History Definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available + * for 30 days after creation. + * + * @param filter The filter to apply on the operation. Only standard filters on definition name and created date are + * supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review History Definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter) { + return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available + * for 30 days after creation. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review History Definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String filter = null; + return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available + * for 30 days after creation. + * + * @param filter The filter to apply on the operation. Only standard filters on definition name and created date are + * supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review History Definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(filter, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available + * for 30 days after creation. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review History Definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String filter = null; + return new PagedIterable<>(listAsync(filter)); + } + + /** + * Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available + * for 30 days after creation. + * + * @param filter The filter to apply on the operation. Only standard filters on definition name and created date are + * supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review History Definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String filter, Context context) { + return new PagedIterable<>(listAsync(filter, context)); + } + + /** + * Get access review history definition by definition Id. + * + * @param historyDefinitionId The id of the access review history definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review history definition by definition Id along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByIdWithResponseAsync(String historyDefinitionId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (historyDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter historyDefinitionId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getById( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + historyDefinitionId, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get access review history definition by definition Id. + * + * @param historyDefinitionId The id of the access review history definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review history definition by definition Id along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByIdWithResponseAsync( + String historyDefinitionId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (historyDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter historyDefinitionId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getById( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + historyDefinitionId, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get access review history definition by definition Id. + * + * @param historyDefinitionId The id of the access review history definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review history definition by definition Id on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByIdAsync(String historyDefinitionId) { + return getByIdWithResponseAsync(historyDefinitionId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get access review history definition by definition Id. + * + * @param historyDefinitionId The id of the access review history definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review history definition by definition Id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessReviewHistoryDefinitionInner getById(String historyDefinitionId) { + return getByIdAsync(historyDefinitionId).block(); + } + + /** + * Get access review history definition by definition Id. + * + * @param historyDefinitionId The id of the access review history definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review history definition by definition Id along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByIdWithResponse( + String historyDefinitionId, Context context) { + return getByIdWithResponseAsync(historyDefinitionId, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review History Definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review History Definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionsImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionsImpl.java new file mode 100644 index 0000000000000..cdfa5d487a81f --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionsImpl.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.authorization.generated.fluent.AccessReviewHistoryDefinitionsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryDefinitionInner; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewHistoryDefinition; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewHistoryDefinitions; + +public final class AccessReviewHistoryDefinitionsImpl implements AccessReviewHistoryDefinitions { + private static final ClientLogger LOGGER = new ClientLogger(AccessReviewHistoryDefinitionsImpl.class); + + private final AccessReviewHistoryDefinitionsClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public AccessReviewHistoryDefinitionsImpl( + AccessReviewHistoryDefinitionsClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new AccessReviewHistoryDefinitionImpl(inner1, this.manager())); + } + + public PagedIterable list(String filter, Context context) { + PagedIterable inner = this.serviceClient().list(filter, context); + return Utils.mapPage(inner, inner1 -> new AccessReviewHistoryDefinitionImpl(inner1, this.manager())); + } + + public AccessReviewHistoryDefinition getById(String historyDefinitionId) { + AccessReviewHistoryDefinitionInner inner = this.serviceClient().getById(historyDefinitionId); + if (inner != null) { + return new AccessReviewHistoryDefinitionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByIdWithResponse(String historyDefinitionId, Context context) { + Response inner = + this.serviceClient().getByIdWithResponse(historyDefinitionId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AccessReviewHistoryDefinitionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private AccessReviewHistoryDefinitionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryInstanceImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryInstanceImpl.java new file mode 100644 index 0000000000000..214c86e05bb7d --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryInstanceImpl.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryInstanceInner; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewHistoryDefinitionStatus; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewHistoryInstance; +import java.time.OffsetDateTime; + +public final class AccessReviewHistoryInstanceImpl implements AccessReviewHistoryInstance { + private AccessReviewHistoryInstanceInner innerObject; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + AccessReviewHistoryInstanceImpl( + AccessReviewHistoryInstanceInner innerObject, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public OffsetDateTime reviewHistoryPeriodStartDateTime() { + return this.innerModel().reviewHistoryPeriodStartDateTime(); + } + + public OffsetDateTime reviewHistoryPeriodEndDateTime() { + return this.innerModel().reviewHistoryPeriodEndDateTime(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public AccessReviewHistoryDefinitionStatus status() { + return this.innerModel().status(); + } + + public OffsetDateTime runDateTime() { + return this.innerModel().runDateTime(); + } + + public OffsetDateTime fulfilledDateTime() { + return this.innerModel().fulfilledDateTime(); + } + + public String downloadUri() { + return this.innerModel().downloadUri(); + } + + public OffsetDateTime expiration() { + return this.innerModel().expiration(); + } + + public AccessReviewHistoryInstanceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceContactedReviewersClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceContactedReviewersClientImpl.java new file mode 100644 index 0000000000000..e8cebd9f3da26 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceContactedReviewersClientImpl.java @@ -0,0 +1,349 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.authorization.generated.fluent.AccessReviewInstanceContactedReviewersClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewContactedReviewerInner; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewContactedReviewerListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * AccessReviewInstanceContactedReviewersClient. + */ +public final class AccessReviewInstanceContactedReviewersClientImpl + implements AccessReviewInstanceContactedReviewersClient { + /** The proxy service used to perform REST calls. */ + private final AccessReviewInstanceContactedReviewersService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of AccessReviewInstanceContactedReviewersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AccessReviewInstanceContactedReviewersClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy + .create( + AccessReviewInstanceContactedReviewersService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AuthorizationManagementClientAccessReviewInstanceContactedReviewers + * to be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + private interface AccessReviewInstanceContactedReviewersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions" + + "/{scheduleDefinitionId}/instances/{id}/contactedReviewers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("scheduleDefinitionId") String scheduleDefinitionId, + @PathParam("id") String id, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance contacted reviewers along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String scheduleDefinitionId, String id) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + id, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance contacted reviewers along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String scheduleDefinitionId, String id, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + id, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance contacted reviewers as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String scheduleDefinitionId, String id) { + return new PagedFlux<>( + () -> listSinglePageAsync(scheduleDefinitionId, id), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance contacted reviewers as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String scheduleDefinitionId, String id, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(scheduleDefinitionId, id, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance contacted reviewers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String scheduleDefinitionId, String id) { + return new PagedIterable<>(listAsync(scheduleDefinitionId, id)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance contacted reviewers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String scheduleDefinitionId, String id, Context context) { + return new PagedIterable<>(listAsync(scheduleDefinitionId, id, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of access review contacted reviewers along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of access review contacted reviewers along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceContactedReviewersImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceContactedReviewersImpl.java new file mode 100644 index 0000000000000..2c1ffa889fcd2 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceContactedReviewersImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.authorization.generated.fluent.AccessReviewInstanceContactedReviewersClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewContactedReviewerInner; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewContactedReviewer; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewInstanceContactedReviewers; + +public final class AccessReviewInstanceContactedReviewersImpl implements AccessReviewInstanceContactedReviewers { + private static final ClientLogger LOGGER = new ClientLogger(AccessReviewInstanceContactedReviewersImpl.class); + + private final AccessReviewInstanceContactedReviewersClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public AccessReviewInstanceContactedReviewersImpl( + AccessReviewInstanceContactedReviewersClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String scheduleDefinitionId, String id) { + PagedIterable inner = this.serviceClient().list(scheduleDefinitionId, id); + return Utils.mapPage(inner, inner1 -> new AccessReviewContactedReviewerImpl(inner1, this.manager())); + } + + public PagedIterable list(String scheduleDefinitionId, String id, Context context) { + PagedIterable inner = + this.serviceClient().list(scheduleDefinitionId, id, context); + return Utils.mapPage(inner, inner1 -> new AccessReviewContactedReviewerImpl(inner1, this.manager())); + } + + private AccessReviewInstanceContactedReviewersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceDecisionsClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceDecisionsClientImpl.java new file mode 100644 index 0000000000000..46f595252e134 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceDecisionsClientImpl.java @@ -0,0 +1,380 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.authorization.generated.fluent.AccessReviewInstanceDecisionsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewDecisionInner; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewDecisionListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AccessReviewInstanceDecisionsClient. */ +public final class AccessReviewInstanceDecisionsClientImpl implements AccessReviewInstanceDecisionsClient { + /** The proxy service used to perform REST calls. */ + private final AccessReviewInstanceDecisionsService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of AccessReviewInstanceDecisionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AccessReviewInstanceDecisionsClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy + .create( + AccessReviewInstanceDecisionsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AuthorizationManagementClientAccessReviewInstanceDecisions to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + private interface AccessReviewInstanceDecisionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions" + + "/{scheduleDefinitionId}/instances/{id}/decisions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("scheduleDefinitionId") String scheduleDefinitionId, + @PathParam("id") String id, + @QueryParam("api-version") String apiVersion, + @QueryParam(value = "$filter", encoded = true) String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance decisions along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String scheduleDefinitionId, String id, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + id, + this.client.getApiVersion(), + filter, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance decisions along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String scheduleDefinitionId, String id, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + id, + this.client.getApiVersion(), + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance decisions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String scheduleDefinitionId, String id, String filter) { + return new PagedFlux<>( + () -> listSinglePageAsync(scheduleDefinitionId, id, filter), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get access review instance decisions. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance decisions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String scheduleDefinitionId, String id) { + final String filter = null; + return new PagedFlux<>( + () -> listSinglePageAsync(scheduleDefinitionId, id, filter), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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 filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance decisions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String scheduleDefinitionId, String id, String filter, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(scheduleDefinitionId, id, filter, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get access review instance decisions. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance decisions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String scheduleDefinitionId, String id) { + final String filter = null; + return new PagedIterable<>(listAsync(scheduleDefinitionId, id, filter)); + } + + /** + * 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 filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance decisions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String scheduleDefinitionId, String id, String filter, Context context) { + return new PagedIterable<>(listAsync(scheduleDefinitionId, id, filter, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of access review decisions along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of access review decisions along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceDecisionsImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceDecisionsImpl.java new file mode 100644 index 0000000000000..c34194624a1f3 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceDecisionsImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.authorization.generated.fluent.AccessReviewInstanceDecisionsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewDecisionInner; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewDecision; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewInstanceDecisions; + +public final class AccessReviewInstanceDecisionsImpl implements AccessReviewInstanceDecisions { + private static final ClientLogger LOGGER = new ClientLogger(AccessReviewInstanceDecisionsImpl.class); + + private final AccessReviewInstanceDecisionsClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public AccessReviewInstanceDecisionsImpl( + AccessReviewInstanceDecisionsClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String scheduleDefinitionId, String id) { + PagedIterable inner = this.serviceClient().list(scheduleDefinitionId, id); + return Utils.mapPage(inner, inner1 -> new AccessReviewDecisionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String scheduleDefinitionId, String id, String filter, Context context) { + PagedIterable inner = + this.serviceClient().list(scheduleDefinitionId, id, filter, context); + return Utils.mapPage(inner, inner1 -> new AccessReviewDecisionImpl(inner1, this.manager())); + } + + private AccessReviewInstanceDecisionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceImpl.java new file mode 100644 index 0000000000000..2ce04afee32ba --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceImpl.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewInstanceInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewInstanceProperties; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewInstance; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewInstanceReviewersType; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewInstanceStatus; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewReviewer; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class AccessReviewInstanceImpl implements AccessReviewInstance, AccessReviewInstance.Definition { + private AccessReviewInstanceInner innerObject; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + AccessReviewInstanceImpl( + AccessReviewInstanceInner innerObject, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public AccessReviewInstanceStatus status() { + return this.innerModel().status(); + } + + public OffsetDateTime startDateTime() { + return this.innerModel().startDateTime(); + } + + public OffsetDateTime endDateTime() { + return this.innerModel().endDateTime(); + } + + public List reviewers() { + List inner = this.innerModel().reviewers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List backupReviewers() { + List inner = this.innerModel().backupReviewers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public AccessReviewInstanceReviewersType reviewersType() { + return this.innerModel().reviewersType(); + } + + public AccessReviewInstanceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } + + private String scheduleDefinitionId; + + private String id; + + private AccessReviewInstanceProperties createProperties; + + public AccessReviewInstanceImpl withExistingAccessReviewScheduleDefinition(String scheduleDefinitionId) { + this.scheduleDefinitionId = scheduleDefinitionId; + return this; + } + + public AccessReviewInstance create() { + this.innerObject = + serviceManager + .serviceClient() + .getAccessReviewInstances() + .createWithResponse(scheduleDefinitionId, id, createProperties, Context.NONE) + .getValue(); + return this; + } + + public AccessReviewInstance create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAccessReviewInstances() + .createWithResponse(scheduleDefinitionId, id, createProperties, context) + .getValue(); + return this; + } + + AccessReviewInstanceImpl( + String name, com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerObject = new AccessReviewInstanceInner(); + this.serviceManager = serviceManager; + this.id = name; + this.createProperties = new AccessReviewInstanceProperties(); + } + + public AccessReviewInstance refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getAccessReviewInstances() + .getByIdWithResponse(scheduleDefinitionId, id, Context.NONE) + .getValue(); + return this; + } + + public AccessReviewInstance refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAccessReviewInstances() + .getByIdWithResponse(scheduleDefinitionId, id, context) + .getValue(); + return this; + } + + public AccessReviewInstanceImpl withStartDateTime(OffsetDateTime startDateTime) { + this.createProperties.withStartDateTime(startDateTime); + return this; + } + + public AccessReviewInstanceImpl withEndDateTime(OffsetDateTime endDateTime) { + this.createProperties.withEndDateTime(endDateTime); + return this; + } + + public AccessReviewInstanceImpl withReviewers(List reviewers) { + this.createProperties.withReviewers(reviewers); + return this; + } + + public AccessReviewInstanceImpl withBackupReviewers(List backupReviewers) { + this.createProperties.withBackupReviewers(backupReviewers); + return this; + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceMyDecisionsClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceMyDecisionsClientImpl.java new file mode 100644 index 0000000000000..7058785b148d0 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceMyDecisionsClientImpl.java @@ -0,0 +1,710 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.authorization.generated.fluent.AccessReviewInstanceMyDecisionsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewDecisionInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewDecisionProperties; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewDecisionListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AccessReviewInstanceMyDecisionsClient. */ +public final class AccessReviewInstanceMyDecisionsClientImpl implements AccessReviewInstanceMyDecisionsClient { + /** The proxy service used to perform REST calls. */ + private final AccessReviewInstanceMyDecisionsService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of AccessReviewInstanceMyDecisionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AccessReviewInstanceMyDecisionsClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy + .create( + AccessReviewInstanceMyDecisionsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AuthorizationManagementClientAccessReviewInstanceMyDecisions to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + private interface AccessReviewInstanceMyDecisionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}" + + "/decisions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("scheduleDefinitionId") String scheduleDefinitionId, + @PathParam("id") String id, + @QueryParam("api-version") String apiVersion, + @QueryParam(value = "$filter", encoded = true) String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}" + + "/decisions/{decisionId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getById( + @HostParam("$host") String endpoint, + @PathParam("scheduleDefinitionId") String scheduleDefinitionId, + @PathParam("id") String id, + @PathParam("decisionId") String decisionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}" + + "/decisions/{decisionId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> patch( + @HostParam("$host") String endpoint, + @PathParam("scheduleDefinitionId") String scheduleDefinitionId, + @PathParam("id") String id, + @PathParam("decisionId") String decisionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AccessReviewDecisionProperties properties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return my access review instance decisions along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String scheduleDefinitionId, String id, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + scheduleDefinitionId, + id, + this.client.getApiVersion(), + filter, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return my access review instance decisions along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String scheduleDefinitionId, String id, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + scheduleDefinitionId, + id, + this.client.getApiVersion(), + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return my access review instance decisions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String scheduleDefinitionId, String id, String filter) { + return new PagedFlux<>( + () -> listSinglePageAsync(scheduleDefinitionId, id, filter), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return my access review instance decisions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String scheduleDefinitionId, String id) { + final String filter = null; + return new PagedFlux<>( + () -> listSinglePageAsync(scheduleDefinitionId, id, filter), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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 filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return my access review instance decisions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String scheduleDefinitionId, String id, String filter, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(scheduleDefinitionId, id, filter, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return my access review instance decisions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String scheduleDefinitionId, String id) { + final String filter = null; + return new PagedIterable<>(listAsync(scheduleDefinitionId, id, filter)); + } + + /** + * 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 filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return my access review instance decisions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String scheduleDefinitionId, String id, String filter, Context context) { + return new PagedIterable<>(listAsync(scheduleDefinitionId, id, filter, context)); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return my single access review instance decision along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByIdWithResponseAsync( + String scheduleDefinitionId, String id, String decisionId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + if (decisionId == null) { + return Mono.error(new IllegalArgumentException("Parameter decisionId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getById( + this.client.getEndpoint(), + scheduleDefinitionId, + id, + decisionId, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return my single access review instance decision along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByIdWithResponseAsync( + String scheduleDefinitionId, String id, String decisionId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + if (decisionId == null) { + return Mono.error(new IllegalArgumentException("Parameter decisionId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getById( + this.client.getEndpoint(), + scheduleDefinitionId, + id, + decisionId, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return my single access review instance decision on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByIdAsync(String scheduleDefinitionId, String id, String decisionId) { + return getByIdWithResponseAsync(scheduleDefinitionId, id, decisionId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return my single access review instance decision. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessReviewDecisionInner getById(String scheduleDefinitionId, String id, String decisionId) { + return getByIdAsync(scheduleDefinitionId, id, decisionId).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return my single access review instance decision along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByIdWithResponse( + String scheduleDefinitionId, String id, String decisionId, Context context) { + return getByIdWithResponseAsync(scheduleDefinitionId, id, decisionId, context).block(); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> patchWithResponseAsync( + String scheduleDefinitionId, String id, String decisionId, AccessReviewDecisionProperties properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + if (decisionId == null) { + return Mono.error(new IllegalArgumentException("Parameter decisionId is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .patch( + this.client.getEndpoint(), + scheduleDefinitionId, + id, + decisionId, + this.client.getApiVersion(), + properties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> patchWithResponseAsync( + String scheduleDefinitionId, + String id, + String decisionId, + AccessReviewDecisionProperties properties, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + if (decisionId == null) { + return Mono.error(new IllegalArgumentException("Parameter decisionId is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .patch( + this.client.getEndpoint(), + scheduleDefinitionId, + id, + decisionId, + this.client.getApiVersion(), + properties, + accept, + context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono patchAsync( + String scheduleDefinitionId, String id, String decisionId, AccessReviewDecisionProperties properties) { + return patchWithResponseAsync(scheduleDefinitionId, id, decisionId, properties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessReviewDecisionInner patch( + String scheduleDefinitionId, String id, String decisionId, AccessReviewDecisionProperties properties) { + return patchAsync(scheduleDefinitionId, id, decisionId, properties).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response patchWithResponse( + String scheduleDefinitionId, + String id, + String decisionId, + AccessReviewDecisionProperties properties, + Context context) { + return patchWithResponseAsync(scheduleDefinitionId, id, decisionId, properties, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of access review decisions along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of access review decisions along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceMyDecisionsImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceMyDecisionsImpl.java new file mode 100644 index 0000000000000..c0c1db3611b50 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceMyDecisionsImpl.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.authorization.generated.fluent.AccessReviewInstanceMyDecisionsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewDecisionInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewDecisionProperties; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewDecision; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewInstanceMyDecisions; + +public final class AccessReviewInstanceMyDecisionsImpl implements AccessReviewInstanceMyDecisions { + private static final ClientLogger LOGGER = new ClientLogger(AccessReviewInstanceMyDecisionsImpl.class); + + private final AccessReviewInstanceMyDecisionsClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public AccessReviewInstanceMyDecisionsImpl( + AccessReviewInstanceMyDecisionsClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String scheduleDefinitionId, String id) { + PagedIterable inner = this.serviceClient().list(scheduleDefinitionId, id); + return Utils.mapPage(inner, inner1 -> new AccessReviewDecisionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String scheduleDefinitionId, String id, String filter, Context context) { + PagedIterable inner = + this.serviceClient().list(scheduleDefinitionId, id, filter, context); + return Utils.mapPage(inner, inner1 -> new AccessReviewDecisionImpl(inner1, this.manager())); + } + + public AccessReviewDecision getById(String scheduleDefinitionId, String id, String decisionId) { + AccessReviewDecisionInner inner = this.serviceClient().getById(scheduleDefinitionId, id, decisionId); + if (inner != null) { + return new AccessReviewDecisionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByIdWithResponse( + String scheduleDefinitionId, String id, String decisionId, Context context) { + Response inner = + this.serviceClient().getByIdWithResponse(scheduleDefinitionId, id, decisionId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AccessReviewDecisionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AccessReviewDecision patch( + String scheduleDefinitionId, String id, String decisionId, AccessReviewDecisionProperties properties) { + AccessReviewDecisionInner inner = this.serviceClient().patch(scheduleDefinitionId, id, decisionId, properties); + if (inner != null) { + return new AccessReviewDecisionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response patchWithResponse( + String scheduleDefinitionId, + String id, + String decisionId, + AccessReviewDecisionProperties properties, + Context context) { + Response inner = + this.serviceClient().patchWithResponse(scheduleDefinitionId, id, decisionId, properties, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AccessReviewDecisionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private AccessReviewInstanceMyDecisionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceOperationsClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceOperationsClientImpl.java new file mode 100644 index 0000000000000..c33b098956fb9 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceOperationsClientImpl.java @@ -0,0 +1,801 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.authorization.generated.fluent.AccessReviewInstanceOperationsClient; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AccessReviewInstanceOperationsClient. */ +public final class AccessReviewInstanceOperationsClientImpl implements AccessReviewInstanceOperationsClient { + /** The proxy service used to perform REST calls. */ + private final AccessReviewInstanceOperationsService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of AccessReviewInstanceOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AccessReviewInstanceOperationsClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy + .create( + AccessReviewInstanceOperationsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AuthorizationManagementClientAccessReviewInstanceOperations to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + private interface AccessReviewInstanceOperationsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions" + + "/{scheduleDefinitionId}/instances/{id}/stop") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> stop( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("scheduleDefinitionId") String scheduleDefinitionId, + @PathParam("id") String id, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions" + + "/{scheduleDefinitionId}/instances/{id}/resetDecisions") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> resetDecisions( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("scheduleDefinitionId") String scheduleDefinitionId, + @PathParam("id") String id, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions" + + "/{scheduleDefinitionId}/instances/{id}/applyDecisions") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> applyDecisions( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("scheduleDefinitionId") String scheduleDefinitionId, + @PathParam("id") String id, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions" + + "/{scheduleDefinitionId}/instances/{id}/sendReminders") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> sendReminders( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("scheduleDefinitionId") String scheduleDefinitionId, + @PathParam("id") String id, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}" + + "/acceptRecommendations") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> acceptRecommendations( + @HostParam("$host") String endpoint, + @PathParam("scheduleDefinitionId") String scheduleDefinitionId, + @PathParam("id") String id, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> stopWithResponseAsync(String scheduleDefinitionId, String id) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .stop( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + id, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> stopWithResponseAsync(String scheduleDefinitionId, String id, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stop( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + id, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync(String scheduleDefinitionId, String id) { + return stopWithResponseAsync(scheduleDefinitionId, id).flatMap(ignored -> Mono.empty()); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stop(String scheduleDefinitionId, String id) { + stopAsync(scheduleDefinitionId, id).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response stopWithResponse(String scheduleDefinitionId, String id, Context context) { + return stopWithResponseAsync(scheduleDefinitionId, id, context).block(); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> resetDecisionsWithResponseAsync(String scheduleDefinitionId, String id) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .resetDecisions( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + id, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> resetDecisionsWithResponseAsync( + String scheduleDefinitionId, String id, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .resetDecisions( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + id, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resetDecisionsAsync(String scheduleDefinitionId, String id) { + return resetDecisionsWithResponseAsync(scheduleDefinitionId, id).flatMap(ignored -> Mono.empty()); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void resetDecisions(String scheduleDefinitionId, String id) { + resetDecisionsAsync(scheduleDefinitionId, id).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response resetDecisionsWithResponse(String scheduleDefinitionId, String id, Context context) { + return resetDecisionsWithResponseAsync(scheduleDefinitionId, id, context).block(); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> applyDecisionsWithResponseAsync(String scheduleDefinitionId, String id) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .applyDecisions( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + id, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> applyDecisionsWithResponseAsync( + String scheduleDefinitionId, String id, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .applyDecisions( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + id, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono applyDecisionsAsync(String scheduleDefinitionId, String id) { + return applyDecisionsWithResponseAsync(scheduleDefinitionId, id).flatMap(ignored -> Mono.empty()); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void applyDecisions(String scheduleDefinitionId, String id) { + applyDecisionsAsync(scheduleDefinitionId, id).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response applyDecisionsWithResponse(String scheduleDefinitionId, String id, Context context) { + return applyDecisionsWithResponseAsync(scheduleDefinitionId, id, context).block(); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> sendRemindersWithResponseAsync(String scheduleDefinitionId, String id) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .sendReminders( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + id, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> sendRemindersWithResponseAsync( + String scheduleDefinitionId, String id, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .sendReminders( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + id, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono sendRemindersAsync(String scheduleDefinitionId, String id) { + return sendRemindersWithResponseAsync(scheduleDefinitionId, id).flatMap(ignored -> Mono.empty()); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void sendReminders(String scheduleDefinitionId, String id) { + sendRemindersAsync(scheduleDefinitionId, id).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response sendRemindersWithResponse(String scheduleDefinitionId, String id, Context context) { + return sendRemindersWithResponseAsync(scheduleDefinitionId, id, context).block(); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> acceptRecommendationsWithResponseAsync(String scheduleDefinitionId, String id) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .acceptRecommendations( + this.client.getEndpoint(), + scheduleDefinitionId, + id, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> acceptRecommendationsWithResponseAsync( + String scheduleDefinitionId, String id, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .acceptRecommendations( + this.client.getEndpoint(), scheduleDefinitionId, id, this.client.getApiVersion(), accept, context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono acceptRecommendationsAsync(String scheduleDefinitionId, String id) { + return acceptRecommendationsWithResponseAsync(scheduleDefinitionId, id).flatMap(ignored -> Mono.empty()); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void acceptRecommendations(String scheduleDefinitionId, String id) { + acceptRecommendationsAsync(scheduleDefinitionId, id).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response acceptRecommendationsWithResponse(String scheduleDefinitionId, String id, Context context) { + return acceptRecommendationsWithResponseAsync(scheduleDefinitionId, id, context).block(); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceOperationsImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceOperationsImpl.java new file mode 100644 index 0000000000000..92dc37176626b --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceOperationsImpl.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.authorization.generated.fluent.AccessReviewInstanceOperationsClient; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewInstanceOperations; + +public final class AccessReviewInstanceOperationsImpl implements AccessReviewInstanceOperations { + private static final ClientLogger LOGGER = new ClientLogger(AccessReviewInstanceOperationsImpl.class); + + private final AccessReviewInstanceOperationsClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public AccessReviewInstanceOperationsImpl( + AccessReviewInstanceOperationsClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void stop(String scheduleDefinitionId, String id) { + this.serviceClient().stop(scheduleDefinitionId, id); + } + + public Response stopWithResponse(String scheduleDefinitionId, String id, Context context) { + return this.serviceClient().stopWithResponse(scheduleDefinitionId, id, context); + } + + public void resetDecisions(String scheduleDefinitionId, String id) { + this.serviceClient().resetDecisions(scheduleDefinitionId, id); + } + + public Response resetDecisionsWithResponse(String scheduleDefinitionId, String id, Context context) { + return this.serviceClient().resetDecisionsWithResponse(scheduleDefinitionId, id, context); + } + + public void applyDecisions(String scheduleDefinitionId, String id) { + this.serviceClient().applyDecisions(scheduleDefinitionId, id); + } + + public Response applyDecisionsWithResponse(String scheduleDefinitionId, String id, Context context) { + return this.serviceClient().applyDecisionsWithResponse(scheduleDefinitionId, id, context); + } + + public void sendReminders(String scheduleDefinitionId, String id) { + this.serviceClient().sendReminders(scheduleDefinitionId, id); + } + + public Response sendRemindersWithResponse(String scheduleDefinitionId, String id, Context context) { + return this.serviceClient().sendRemindersWithResponse(scheduleDefinitionId, id, context); + } + + public void acceptRecommendations(String scheduleDefinitionId, String id) { + this.serviceClient().acceptRecommendations(scheduleDefinitionId, id); + } + + public Response acceptRecommendationsWithResponse(String scheduleDefinitionId, String id, Context context) { + return this.serviceClient().acceptRecommendationsWithResponse(scheduleDefinitionId, id, context); + } + + private AccessReviewInstanceOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstancesAssignedForMyApprovalsClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstancesAssignedForMyApprovalsClientImpl.java new file mode 100644 index 0000000000000..2a4b63ed68c12 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstancesAssignedForMyApprovalsClientImpl.java @@ -0,0 +1,479 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.authorization.generated.fluent.AccessReviewInstancesAssignedForMyApprovalsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewInstanceInner; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewInstanceListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * AccessReviewInstancesAssignedForMyApprovalsClient. + */ +public final class AccessReviewInstancesAssignedForMyApprovalsClientImpl + implements AccessReviewInstancesAssignedForMyApprovalsClient { + /** The proxy service used to perform REST calls. */ + private final AccessReviewInstancesAssignedForMyApprovalsService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of AccessReviewInstancesAssignedForMyApprovalsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AccessReviewInstancesAssignedForMyApprovalsClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy + .create( + AccessReviewInstancesAssignedForMyApprovalsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * AuthorizationManagementClientAccessReviewInstancesAssignedForMyApprovals to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + private interface AccessReviewInstancesAssignedForMyApprovalsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("scheduleDefinitionId") String scheduleDefinitionId, + @QueryParam("api-version") String apiVersion, + @QueryParam(value = "$filter", encoded = true) String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getById( + @HostParam("$host") String endpoint, + @PathParam("scheduleDefinitionId") String scheduleDefinitionId, + @PathParam("id") String id, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get access review instances assigned for my approval. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances assigned for my approval along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String scheduleDefinitionId, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + scheduleDefinitionId, + this.client.getApiVersion(), + filter, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get access review instances assigned for my approval. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances assigned for my approval along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String scheduleDefinitionId, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), scheduleDefinitionId, this.client.getApiVersion(), filter, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get access review instances assigned for my approval. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances assigned for my approval as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String scheduleDefinitionId, String filter) { + return new PagedFlux<>( + () -> listSinglePageAsync(scheduleDefinitionId, filter), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get access review instances assigned for my approval. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances assigned for my approval as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String scheduleDefinitionId) { + final String filter = null; + return new PagedFlux<>( + () -> listSinglePageAsync(scheduleDefinitionId, filter), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get access review instances assigned for my approval. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances assigned for my approval as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String scheduleDefinitionId, String filter, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(scheduleDefinitionId, filter, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get access review instances assigned for my approval. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances assigned for my approval as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String scheduleDefinitionId) { + final String filter = null; + return new PagedIterable<>(listAsync(scheduleDefinitionId, filter)); + } + + /** + * Get access review instances assigned for my approval. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances assigned for my approval as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String scheduleDefinitionId, String filter, Context context) { + return new PagedIterable<>(listAsync(scheduleDefinitionId, filter, context)); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single access review instance assigned for my approval along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByIdWithResponseAsync(String scheduleDefinitionId, String id) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getById( + this.client.getEndpoint(), + scheduleDefinitionId, + id, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single access review instance assigned for my approval along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByIdWithResponseAsync( + String scheduleDefinitionId, String id, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getById(this.client.getEndpoint(), scheduleDefinitionId, id, this.client.getApiVersion(), accept, context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single access review instance assigned for my approval on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByIdAsync(String scheduleDefinitionId, String id) { + return getByIdWithResponseAsync(scheduleDefinitionId, id).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single access review instance assigned for my approval. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessReviewInstanceInner getById(String scheduleDefinitionId, String id) { + return getByIdAsync(scheduleDefinitionId, id).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single access review instance assigned for my approval along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByIdWithResponse( + String scheduleDefinitionId, String id, Context context) { + return getByIdWithResponseAsync(scheduleDefinitionId, id, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review Instances along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review Instances along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstancesAssignedForMyApprovalsImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstancesAssignedForMyApprovalsImpl.java new file mode 100644 index 0000000000000..f30f880f77e5c --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstancesAssignedForMyApprovalsImpl.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.authorization.generated.fluent.AccessReviewInstancesAssignedForMyApprovalsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewInstanceInner; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewInstance; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewInstancesAssignedForMyApprovals; + +public final class AccessReviewInstancesAssignedForMyApprovalsImpl + implements AccessReviewInstancesAssignedForMyApprovals { + private static final ClientLogger LOGGER = new ClientLogger(AccessReviewInstancesAssignedForMyApprovalsImpl.class); + + private final AccessReviewInstancesAssignedForMyApprovalsClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public AccessReviewInstancesAssignedForMyApprovalsImpl( + AccessReviewInstancesAssignedForMyApprovalsClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String scheduleDefinitionId) { + PagedIterable inner = this.serviceClient().list(scheduleDefinitionId); + return Utils.mapPage(inner, inner1 -> new AccessReviewInstanceImpl(inner1, this.manager())); + } + + public PagedIterable list(String scheduleDefinitionId, String filter, Context context) { + PagedIterable inner = + this.serviceClient().list(scheduleDefinitionId, filter, context); + return Utils.mapPage(inner, inner1 -> new AccessReviewInstanceImpl(inner1, this.manager())); + } + + public AccessReviewInstance getById(String scheduleDefinitionId, String id) { + AccessReviewInstanceInner inner = this.serviceClient().getById(scheduleDefinitionId, id); + if (inner != null) { + return new AccessReviewInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByIdWithResponse(String scheduleDefinitionId, String id, Context context) { + Response inner = + this.serviceClient().getByIdWithResponse(scheduleDefinitionId, id, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AccessReviewInstanceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private AccessReviewInstancesAssignedForMyApprovalsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstancesClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstancesClientImpl.java new file mode 100644 index 0000000000000..46d0f480b6005 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstancesClientImpl.java @@ -0,0 +1,693 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.authorization.generated.fluent.AccessReviewInstancesClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewInstanceInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewInstanceProperties; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewInstanceListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AccessReviewInstancesClient. */ +public final class AccessReviewInstancesClientImpl implements AccessReviewInstancesClient { + /** The proxy service used to perform REST calls. */ + private final AccessReviewInstancesService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of AccessReviewInstancesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AccessReviewInstancesClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy + .create(AccessReviewInstancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AuthorizationManagementClientAccessReviewInstances to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + private interface AccessReviewInstancesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions" + + "/{scheduleDefinitionId}/instances") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("scheduleDefinitionId") String scheduleDefinitionId, + @QueryParam("api-version") String apiVersion, + @QueryParam(value = "$filter", encoded = true) String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions" + + "/{scheduleDefinitionId}/instances/{id}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getById( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("scheduleDefinitionId") String scheduleDefinitionId, + @PathParam("id") String id, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions" + + "/{scheduleDefinitionId}/instances/{id}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("scheduleDefinitionId") String scheduleDefinitionId, + @PathParam("id") String id, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AccessReviewInstanceProperties properties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get access review instances. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String scheduleDefinitionId, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + this.client.getApiVersion(), + filter, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get access review instances. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String scheduleDefinitionId, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + this.client.getApiVersion(), + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get access review instances. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String scheduleDefinitionId, String filter) { + return new PagedFlux<>( + () -> listSinglePageAsync(scheduleDefinitionId, filter), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get access review instances. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String scheduleDefinitionId) { + final String filter = null; + return new PagedFlux<>( + () -> listSinglePageAsync(scheduleDefinitionId, filter), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get access review instances. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String scheduleDefinitionId, String filter, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(scheduleDefinitionId, filter, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get access review instances. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String scheduleDefinitionId) { + final String filter = null; + return new PagedIterable<>(listAsync(scheduleDefinitionId, filter)); + } + + /** + * Get access review instances. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String scheduleDefinitionId, String filter, Context context) { + return new PagedIterable<>(listAsync(scheduleDefinitionId, filter, context)); + } + + /** + * Get access review instances. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByIdWithResponseAsync(String scheduleDefinitionId, String id) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getById( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + id, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get access review instances. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByIdWithResponseAsync( + String scheduleDefinitionId, String id, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getById( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + id, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get access review instances. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByIdAsync(String scheduleDefinitionId, String id) { + return getByIdWithResponseAsync(scheduleDefinitionId, id).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get access review instances. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessReviewInstanceInner getById(String scheduleDefinitionId, String id) { + return getByIdAsync(scheduleDefinitionId, id).block(); + } + + /** + * Get access review instances. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByIdWithResponse( + String scheduleDefinitionId, String id, Context context) { + return getByIdWithResponseAsync(scheduleDefinitionId, id, context).block(); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review Instance along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String scheduleDefinitionId, String id, AccessReviewInstanceProperties properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + id, + this.client.getApiVersion(), + properties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review Instance along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String scheduleDefinitionId, String id, AccessReviewInstanceProperties properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + id, + this.client.getApiVersion(), + properties, + accept, + context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review Instance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String scheduleDefinitionId, String id, AccessReviewInstanceProperties properties) { + return createWithResponseAsync(scheduleDefinitionId, id, properties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessReviewInstanceInner create( + String scheduleDefinitionId, String id, AccessReviewInstanceProperties properties) { + return createAsync(scheduleDefinitionId, id, properties).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review Instance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String scheduleDefinitionId, String id, AccessReviewInstanceProperties properties, Context context) { + return createWithResponseAsync(scheduleDefinitionId, id, properties, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review Instances along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review Instances along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstancesImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstancesImpl.java new file mode 100644 index 0000000000000..1386fdc250daf --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstancesImpl.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.authorization.generated.fluent.AccessReviewInstancesClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewInstanceInner; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewInstance; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewInstances; + +public final class AccessReviewInstancesImpl implements AccessReviewInstances { + private static final ClientLogger LOGGER = new ClientLogger(AccessReviewInstancesImpl.class); + + private final AccessReviewInstancesClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public AccessReviewInstancesImpl( + AccessReviewInstancesClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String scheduleDefinitionId) { + PagedIterable inner = this.serviceClient().list(scheduleDefinitionId); + return Utils.mapPage(inner, inner1 -> new AccessReviewInstanceImpl(inner1, this.manager())); + } + + public PagedIterable list(String scheduleDefinitionId, String filter, Context context) { + PagedIterable inner = + this.serviceClient().list(scheduleDefinitionId, filter, context); + return Utils.mapPage(inner, inner1 -> new AccessReviewInstanceImpl(inner1, this.manager())); + } + + public AccessReviewInstance getById(String scheduleDefinitionId, String id) { + AccessReviewInstanceInner inner = this.serviceClient().getById(scheduleDefinitionId, id); + if (inner != null) { + return new AccessReviewInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByIdWithResponse(String scheduleDefinitionId, String id, Context context) { + Response inner = + this.serviceClient().getByIdWithResponse(scheduleDefinitionId, id, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AccessReviewInstanceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private AccessReviewInstancesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } + + public AccessReviewInstanceImpl define(String name) { + return new AccessReviewInstanceImpl(name, this.manager()); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewScheduleDefinitionImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewScheduleDefinitionImpl.java new file mode 100644 index 0000000000000..1b0d7fd194be5 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewScheduleDefinitionImpl.java @@ -0,0 +1,535 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewInstanceInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewScheduleDefinitionInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewScheduleDefinitionProperties; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewActorIdentityType; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewInstance; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewRecurrencePatternType; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewRecurrenceRangeType; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewReviewer; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewScheduleDefinition; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewScheduleDefinitionReviewersType; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewScheduleDefinitionStatus; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewScopeAssignmentState; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewScopePrincipalType; +import com.azure.resourcemanager.authorization.generated.models.DefaultDecisionType; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class AccessReviewScheduleDefinitionImpl + implements AccessReviewScheduleDefinition, + AccessReviewScheduleDefinition.Definition, + AccessReviewScheduleDefinition.Update { + private AccessReviewScheduleDefinitionInner innerObject; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public AccessReviewScheduleDefinitionStatus status() { + return this.innerModel().status(); + } + + public String descriptionForAdmins() { + return this.innerModel().descriptionForAdmins(); + } + + public String descriptionForReviewers() { + return this.innerModel().descriptionForReviewers(); + } + + public List reviewers() { + List inner = this.innerModel().reviewers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List backupReviewers() { + List inner = this.innerModel().backupReviewers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public AccessReviewScheduleDefinitionReviewersType reviewersType() { + return this.innerModel().reviewersType(); + } + + public List instances() { + List inner = this.innerModel().instances(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new AccessReviewInstanceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String principalId() { + return this.innerModel().principalId(); + } + + public AccessReviewActorIdentityType principalType() { + return this.innerModel().principalType(); + } + + public String principalName() { + return this.innerModel().principalName(); + } + + public String userPrincipalName() { + return this.innerModel().userPrincipalName(); + } + + public Boolean mailNotificationsEnabled() { + return this.innerModel().mailNotificationsEnabled(); + } + + public Boolean reminderNotificationsEnabled() { + return this.innerModel().reminderNotificationsEnabled(); + } + + public Boolean defaultDecisionEnabled() { + return this.innerModel().defaultDecisionEnabled(); + } + + public Boolean justificationRequiredOnApproval() { + return this.innerModel().justificationRequiredOnApproval(); + } + + public DefaultDecisionType defaultDecision() { + return this.innerModel().defaultDecision(); + } + + public Boolean autoApplyDecisionsEnabled() { + return this.innerModel().autoApplyDecisionsEnabled(); + } + + public Boolean recommendationsEnabled() { + return this.innerModel().recommendationsEnabled(); + } + + public Duration recommendationLookBackDuration() { + return this.innerModel().recommendationLookBackDuration(); + } + + public Integer instanceDurationInDays() { + return this.innerModel().instanceDurationInDays(); + } + + public AccessReviewRecurrencePatternType typePropertiesType() { + return this.innerModel().typePropertiesType(); + } + + public Integer interval() { + return this.innerModel().interval(); + } + + public AccessReviewRecurrenceRangeType typeRangeType() { + return this.innerModel().typeRangeType(); + } + + public Integer numberOfOccurrences() { + return this.innerModel().numberOfOccurrences(); + } + + public OffsetDateTime startDate() { + return this.innerModel().startDate(); + } + + public OffsetDateTime endDate() { + return this.innerModel().endDate(); + } + + public String resourceId() { + return this.innerModel().resourceId(); + } + + public String roleDefinitionId() { + return this.innerModel().roleDefinitionId(); + } + + public AccessReviewScopePrincipalType principalTypeScopePrincipalType() { + return this.innerModel().principalTypeScopePrincipalType(); + } + + public AccessReviewScopeAssignmentState assignmentState() { + return this.innerModel().assignmentState(); + } + + public Duration inactiveDuration() { + return this.innerModel().inactiveDuration(); + } + + public Boolean expandNestedMemberships() { + return this.innerModel().expandNestedMemberships(); + } + + public Boolean includeInheritedAccess() { + return this.innerModel().includeInheritedAccess(); + } + + public Boolean includeAccessBelowResource() { + return this.innerModel().includeAccessBelowResource(); + } + + public String excludeResourceId() { + return this.innerModel().excludeResourceId(); + } + + public String excludeRoleDefinitionId() { + return this.innerModel().excludeRoleDefinitionId(); + } + + public AccessReviewScheduleDefinitionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } + + private String scheduleDefinitionId; + + private AccessReviewScheduleDefinitionProperties createProperties; + + private AccessReviewScheduleDefinitionProperties updateProperties; + + public AccessReviewScheduleDefinition create() { + this.innerObject = + serviceManager + .serviceClient() + .getAccessReviewScheduleDefinitions() + .createOrUpdateByIdWithResponse(scheduleDefinitionId, createProperties, Context.NONE) + .getValue(); + return this; + } + + public AccessReviewScheduleDefinition create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAccessReviewScheduleDefinitions() + .createOrUpdateByIdWithResponse(scheduleDefinitionId, createProperties, context) + .getValue(); + return this; + } + + AccessReviewScheduleDefinitionImpl( + String name, com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerObject = new AccessReviewScheduleDefinitionInner(); + this.serviceManager = serviceManager; + this.scheduleDefinitionId = name; + this.createProperties = new AccessReviewScheduleDefinitionProperties(); + } + + public AccessReviewScheduleDefinitionImpl update() { + this.updateProperties = new AccessReviewScheduleDefinitionProperties(); + return this; + } + + public AccessReviewScheduleDefinition apply() { + this.innerObject = + serviceManager + .serviceClient() + .getAccessReviewScheduleDefinitions() + .createOrUpdateByIdWithResponse(scheduleDefinitionId, updateProperties, Context.NONE) + .getValue(); + return this; + } + + public AccessReviewScheduleDefinition apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAccessReviewScheduleDefinitions() + .createOrUpdateByIdWithResponse(scheduleDefinitionId, updateProperties, context) + .getValue(); + return this; + } + + AccessReviewScheduleDefinitionImpl( + AccessReviewScheduleDefinitionInner innerObject, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.scheduleDefinitionId = Utils.getValueFromIdByName(innerObject.id(), "accessReviewScheduleDefinitions"); + } + + public AccessReviewScheduleDefinition refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getAccessReviewScheduleDefinitions() + .getByIdWithResponse(scheduleDefinitionId, Context.NONE) + .getValue(); + return this; + } + + public AccessReviewScheduleDefinition refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAccessReviewScheduleDefinitions() + .getByIdWithResponse(scheduleDefinitionId, context) + .getValue(); + return this; + } + + public void stop() { + serviceManager.accessReviewScheduleDefinitions().stop(scheduleDefinitionId); + } + + public Response stopWithResponse(Context context) { + return serviceManager.accessReviewScheduleDefinitions().stopWithResponse(scheduleDefinitionId, context); + } + + public AccessReviewScheduleDefinitionImpl withDisplayName(String displayName) { + if (isInCreateMode()) { + this.createProperties.withDisplayName(displayName); + return this; + } else { + this.updateProperties.withDisplayName(displayName); + return this; + } + } + + public AccessReviewScheduleDefinitionImpl withDescriptionForAdmins(String descriptionForAdmins) { + if (isInCreateMode()) { + this.createProperties.withDescriptionForAdmins(descriptionForAdmins); + return this; + } else { + this.updateProperties.withDescriptionForAdmins(descriptionForAdmins); + return this; + } + } + + public AccessReviewScheduleDefinitionImpl withDescriptionForReviewers(String descriptionForReviewers) { + if (isInCreateMode()) { + this.createProperties.withDescriptionForReviewers(descriptionForReviewers); + return this; + } else { + this.updateProperties.withDescriptionForReviewers(descriptionForReviewers); + return this; + } + } + + public AccessReviewScheduleDefinitionImpl withReviewers(List reviewers) { + if (isInCreateMode()) { + this.createProperties.withReviewers(reviewers); + return this; + } else { + this.updateProperties.withReviewers(reviewers); + return this; + } + } + + public AccessReviewScheduleDefinitionImpl withBackupReviewers(List backupReviewers) { + if (isInCreateMode()) { + this.createProperties.withBackupReviewers(backupReviewers); + return this; + } else { + this.updateProperties.withBackupReviewers(backupReviewers); + return this; + } + } + + public AccessReviewScheduleDefinitionImpl withInstances(List instances) { + if (isInCreateMode()) { + this.createProperties.withInstances(instances); + return this; + } else { + this.updateProperties.withInstances(instances); + return this; + } + } + + public AccessReviewScheduleDefinitionImpl withMailNotificationsEnabled(Boolean mailNotificationsEnabled) { + if (isInCreateMode()) { + this.createProperties.withMailNotificationsEnabled(mailNotificationsEnabled); + return this; + } else { + this.updateProperties.withMailNotificationsEnabled(mailNotificationsEnabled); + return this; + } + } + + public AccessReviewScheduleDefinitionImpl withReminderNotificationsEnabled(Boolean reminderNotificationsEnabled) { + if (isInCreateMode()) { + this.createProperties.withReminderNotificationsEnabled(reminderNotificationsEnabled); + return this; + } else { + this.updateProperties.withReminderNotificationsEnabled(reminderNotificationsEnabled); + return this; + } + } + + public AccessReviewScheduleDefinitionImpl withDefaultDecisionEnabled(Boolean defaultDecisionEnabled) { + if (isInCreateMode()) { + this.createProperties.withDefaultDecisionEnabled(defaultDecisionEnabled); + return this; + } else { + this.updateProperties.withDefaultDecisionEnabled(defaultDecisionEnabled); + return this; + } + } + + public AccessReviewScheduleDefinitionImpl withJustificationRequiredOnApproval( + Boolean justificationRequiredOnApproval) { + if (isInCreateMode()) { + this.createProperties.withJustificationRequiredOnApproval(justificationRequiredOnApproval); + return this; + } else { + this.updateProperties.withJustificationRequiredOnApproval(justificationRequiredOnApproval); + return this; + } + } + + public AccessReviewScheduleDefinitionImpl withDefaultDecision(DefaultDecisionType defaultDecision) { + if (isInCreateMode()) { + this.createProperties.withDefaultDecision(defaultDecision); + return this; + } else { + this.updateProperties.withDefaultDecision(defaultDecision); + return this; + } + } + + public AccessReviewScheduleDefinitionImpl withAutoApplyDecisionsEnabled(Boolean autoApplyDecisionsEnabled) { + if (isInCreateMode()) { + this.createProperties.withAutoApplyDecisionsEnabled(autoApplyDecisionsEnabled); + return this; + } else { + this.updateProperties.withAutoApplyDecisionsEnabled(autoApplyDecisionsEnabled); + return this; + } + } + + public AccessReviewScheduleDefinitionImpl withRecommendationsEnabled(Boolean recommendationsEnabled) { + if (isInCreateMode()) { + this.createProperties.withRecommendationsEnabled(recommendationsEnabled); + return this; + } else { + this.updateProperties.withRecommendationsEnabled(recommendationsEnabled); + return this; + } + } + + public AccessReviewScheduleDefinitionImpl withRecommendationLookBackDuration( + Duration recommendationLookBackDuration) { + if (isInCreateMode()) { + this.createProperties.withRecommendationLookBackDuration(recommendationLookBackDuration); + return this; + } else { + this.updateProperties.withRecommendationLookBackDuration(recommendationLookBackDuration); + return this; + } + } + + public AccessReviewScheduleDefinitionImpl withInstanceDurationInDays(Integer instanceDurationInDays) { + if (isInCreateMode()) { + this.createProperties.withInstanceDurationInDays(instanceDurationInDays); + return this; + } else { + this.updateProperties.withInstanceDurationInDays(instanceDurationInDays); + return this; + } + } + + public AccessReviewScheduleDefinitionImpl withType(AccessReviewRecurrencePatternType type) { + if (isInCreateMode()) { + this.createProperties.withType(type); + return this; + } else { + this.updateProperties.withType(type); + return this; + } + } + + public AccessReviewScheduleDefinitionImpl withInterval(Integer interval) { + if (isInCreateMode()) { + this.createProperties.withInterval(interval); + return this; + } else { + this.updateProperties.withInterval(interval); + return this; + } + } + + public AccessReviewScheduleDefinitionImpl withTypeRangeType(AccessReviewRecurrenceRangeType typeRangeType) { + if (isInCreateMode()) { + this.createProperties.withTypeRangeType(typeRangeType); + return this; + } else { + this.updateProperties.withTypeRangeType(typeRangeType); + return this; + } + } + + public AccessReviewScheduleDefinitionImpl withNumberOfOccurrences(Integer numberOfOccurrences) { + if (isInCreateMode()) { + this.createProperties.withNumberOfOccurrences(numberOfOccurrences); + return this; + } else { + this.updateProperties.withNumberOfOccurrences(numberOfOccurrences); + return this; + } + } + + public AccessReviewScheduleDefinitionImpl withStartDate(OffsetDateTime startDate) { + if (isInCreateMode()) { + this.createProperties.withStartDate(startDate); + return this; + } else { + this.updateProperties.withStartDate(startDate); + return this; + } + } + + public AccessReviewScheduleDefinitionImpl withEndDate(OffsetDateTime endDate) { + if (isInCreateMode()) { + this.createProperties.withEndDate(endDate); + return this; + } else { + this.updateProperties.withEndDate(endDate); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewScheduleDefinitionsAssignedForMyApprovalsClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewScheduleDefinitionsAssignedForMyApprovalsClientImpl.java new file mode 100644 index 0000000000000..a438794ac95bb --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewScheduleDefinitionsAssignedForMyApprovalsClientImpl.java @@ -0,0 +1,316 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.authorization.generated.fluent.AccessReviewScheduleDefinitionsAssignedForMyApprovalsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewScheduleDefinitionInner; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewScheduleDefinitionListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * AccessReviewScheduleDefinitionsAssignedForMyApprovalsClient. + */ +public final class AccessReviewScheduleDefinitionsAssignedForMyApprovalsClientImpl + implements AccessReviewScheduleDefinitionsAssignedForMyApprovalsClient { + /** The proxy service used to perform REST calls. */ + private final AccessReviewScheduleDefinitionsAssignedForMyApprovalsService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of AccessReviewScheduleDefinitionsAssignedForMyApprovalsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AccessReviewScheduleDefinitionsAssignedForMyApprovalsClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy + .create( + AccessReviewScheduleDefinitionsAssignedForMyApprovalsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * AuthorizationManagementClientAccessReviewScheduleDefinitionsAssignedForMyApprovals to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + private interface AccessReviewScheduleDefinitionsAssignedForMyApprovalsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Authorization/accessReviewScheduleDefinitions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @QueryParam(value = "$filter", encoded = true) String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get access review instances assigned for my approval. + * + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances assigned for my approval along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service.list(this.client.getEndpoint(), this.client.getApiVersion(), filter, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get access review instances assigned for my approval. + * + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances assigned for my approval along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), filter, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get access review instances assigned for my approval. + * + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances assigned for my approval as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter) { + return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get access review instances assigned for my approval. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances assigned for my approval as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String filter = null; + return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get access review instances assigned for my approval. + * + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances assigned for my approval as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(filter, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get access review instances assigned for my approval. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances assigned for my approval as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String filter = null; + return new PagedIterable<>(listAsync(filter)); + } + + /** + * Get access review instances assigned for my approval. + * + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances assigned for my approval as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String filter, Context context) { + return new PagedIterable<>(listAsync(filter, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review Schedule Definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review Schedule Definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewScheduleDefinitionsAssignedForMyApprovalsImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewScheduleDefinitionsAssignedForMyApprovalsImpl.java new file mode 100644 index 0000000000000..b19783e7d9936 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewScheduleDefinitionsAssignedForMyApprovalsImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.authorization.generated.fluent.AccessReviewScheduleDefinitionsAssignedForMyApprovalsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewScheduleDefinitionInner; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewScheduleDefinition; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewScheduleDefinitionsAssignedForMyApprovals; + +public final class AccessReviewScheduleDefinitionsAssignedForMyApprovalsImpl + implements AccessReviewScheduleDefinitionsAssignedForMyApprovals { + private static final ClientLogger LOGGER = + new ClientLogger(AccessReviewScheduleDefinitionsAssignedForMyApprovalsImpl.class); + + private final AccessReviewScheduleDefinitionsAssignedForMyApprovalsClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public AccessReviewScheduleDefinitionsAssignedForMyApprovalsImpl( + AccessReviewScheduleDefinitionsAssignedForMyApprovalsClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new AccessReviewScheduleDefinitionImpl(inner1, this.manager())); + } + + public PagedIterable list(String filter, Context context) { + PagedIterable inner = this.serviceClient().list(filter, context); + return Utils.mapPage(inner, inner1 -> new AccessReviewScheduleDefinitionImpl(inner1, this.manager())); + } + + private AccessReviewScheduleDefinitionsAssignedForMyApprovalsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewScheduleDefinitionsClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewScheduleDefinitionsClientImpl.java new file mode 100644 index 0000000000000..103ad1e3f29a3 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewScheduleDefinitionsClientImpl.java @@ -0,0 +1,922 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.authorization.generated.fluent.AccessReviewScheduleDefinitionsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewScheduleDefinitionInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewScheduleDefinitionProperties; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewScheduleDefinitionListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AccessReviewScheduleDefinitionsClient. */ +public final class AccessReviewScheduleDefinitionsClientImpl implements AccessReviewScheduleDefinitionsClient { + /** The proxy service used to perform REST calls. */ + private final AccessReviewScheduleDefinitionsService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of AccessReviewScheduleDefinitionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AccessReviewScheduleDefinitionsClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy + .create( + AccessReviewScheduleDefinitionsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AuthorizationManagementClientAccessReviewScheduleDefinitions to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + private interface AccessReviewScheduleDefinitionsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @QueryParam(value = "$filter", encoded = true) String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions" + + "/{scheduleDefinitionId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getById( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("scheduleDefinitionId") String scheduleDefinitionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions" + + "/{scheduleDefinitionId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> deleteById( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("scheduleDefinitionId") String scheduleDefinitionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions" + + "/{scheduleDefinitionId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdateById( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("scheduleDefinitionId") String scheduleDefinitionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AccessReviewScheduleDefinitionProperties properties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions" + + "/{scheduleDefinitionId}/stop") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> stop( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("scheduleDefinitionId") String scheduleDefinitionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get access review schedule definitions. + * + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review schedule definitions along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + filter, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get access review schedule definitions. + * + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review schedule definitions along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get access review schedule definitions. + * + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review schedule definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter) { + return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get access review schedule definitions. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review schedule definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String filter = null; + return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get access review schedule definitions. + * + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review schedule definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(filter, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get access review schedule definitions. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review schedule definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String filter = null; + return new PagedIterable<>(listAsync(filter)); + } + + /** + * Get access review schedule definitions. + * + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review schedule definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String filter, Context context) { + return new PagedIterable<>(listAsync(filter, context)); + } + + /** + * Get single access review definition. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single access review definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByIdWithResponseAsync(String scheduleDefinitionId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getById( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get single access review definition. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single access review definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByIdWithResponseAsync( + String scheduleDefinitionId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getById( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get single access review definition. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single access review definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByIdAsync(String scheduleDefinitionId) { + return getByIdWithResponseAsync(scheduleDefinitionId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get single access review definition. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single access review definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessReviewScheduleDefinitionInner getById(String scheduleDefinitionId) { + return getByIdAsync(scheduleDefinitionId).block(); + } + + /** + * Get single access review definition. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single access review definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByIdWithResponse( + String scheduleDefinitionId, Context context) { + return getByIdWithResponseAsync(scheduleDefinitionId, context).block(); + } + + /** + * Delete access review schedule definition. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteByIdWithResponseAsync(String scheduleDefinitionId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteById( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete access review schedule definition. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteByIdWithResponseAsync(String scheduleDefinitionId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteById( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete access review schedule definition. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteByIdAsync(String scheduleDefinitionId) { + return deleteByIdWithResponseAsync(scheduleDefinitionId).flatMap(ignored -> Mono.empty()); + } + + /** + * Delete access review schedule definition. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteById(String scheduleDefinitionId) { + deleteByIdAsync(scheduleDefinitionId).block(); + } + + /** + * Delete access review schedule definition. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteByIdWithResponse(String scheduleDefinitionId, Context context) { + return deleteByIdWithResponseAsync(scheduleDefinitionId, context).block(); + } + + /** + * Create or Update access review schedule definition. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param properties Access review schedule definition properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review Schedule Definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateByIdWithResponseAsync( + String scheduleDefinitionId, AccessReviewScheduleDefinitionProperties properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdateById( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + this.client.getApiVersion(), + properties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review Schedule Definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateByIdWithResponseAsync( + String scheduleDefinitionId, AccessReviewScheduleDefinitionProperties properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdateById( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + this.client.getApiVersion(), + properties, + accept, + context); + } + + /** + * Create or Update access review schedule definition. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param properties Access review schedule definition properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review Schedule Definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateByIdAsync( + String scheduleDefinitionId, AccessReviewScheduleDefinitionProperties properties) { + return createOrUpdateByIdWithResponseAsync(scheduleDefinitionId, properties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create or Update access review schedule definition. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param properties Access review schedule definition properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review Schedule Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessReviewScheduleDefinitionInner createOrUpdateById( + String scheduleDefinitionId, AccessReviewScheduleDefinitionProperties properties) { + return createOrUpdateByIdAsync(scheduleDefinitionId, properties).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review Schedule Definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateByIdWithResponse( + String scheduleDefinitionId, AccessReviewScheduleDefinitionProperties properties, Context context) { + return createOrUpdateByIdWithResponseAsync(scheduleDefinitionId, properties, context).block(); + } + + /** + * Stop access review definition. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> stopWithResponseAsync(String scheduleDefinitionId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .stop( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Stop access review definition. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> stopWithResponseAsync(String scheduleDefinitionId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stop( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Stop access review definition. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync(String scheduleDefinitionId) { + return stopWithResponseAsync(scheduleDefinitionId).flatMap(ignored -> Mono.empty()); + } + + /** + * Stop access review definition. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stop(String scheduleDefinitionId) { + stopAsync(scheduleDefinitionId).block(); + } + + /** + * Stop access review definition. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response stopWithResponse(String scheduleDefinitionId, Context context) { + return stopWithResponseAsync(scheduleDefinitionId, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review Schedule Definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review Schedule Definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewScheduleDefinitionsImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewScheduleDefinitionsImpl.java new file mode 100644 index 0000000000000..274facf8166ae --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewScheduleDefinitionsImpl.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.authorization.generated.fluent.AccessReviewScheduleDefinitionsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewScheduleDefinitionInner; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewScheduleDefinition; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewScheduleDefinitions; + +public final class AccessReviewScheduleDefinitionsImpl implements AccessReviewScheduleDefinitions { + private static final ClientLogger LOGGER = new ClientLogger(AccessReviewScheduleDefinitionsImpl.class); + + private final AccessReviewScheduleDefinitionsClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public AccessReviewScheduleDefinitionsImpl( + AccessReviewScheduleDefinitionsClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new AccessReviewScheduleDefinitionImpl(inner1, this.manager())); + } + + public PagedIterable list(String filter, Context context) { + PagedIterable inner = this.serviceClient().list(filter, context); + return Utils.mapPage(inner, inner1 -> new AccessReviewScheduleDefinitionImpl(inner1, this.manager())); + } + + public AccessReviewScheduleDefinition getById(String scheduleDefinitionId) { + AccessReviewScheduleDefinitionInner inner = this.serviceClient().getById(scheduleDefinitionId); + if (inner != null) { + return new AccessReviewScheduleDefinitionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByIdWithResponse(String scheduleDefinitionId, Context context) { + Response inner = + this.serviceClient().getByIdWithResponse(scheduleDefinitionId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AccessReviewScheduleDefinitionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteById(String scheduleDefinitionId) { + this.serviceClient().deleteById(scheduleDefinitionId); + } + + public Response deleteByIdWithResponse(String scheduleDefinitionId, Context context) { + return this.serviceClient().deleteByIdWithResponse(scheduleDefinitionId, context); + } + + public void stop(String scheduleDefinitionId) { + this.serviceClient().stop(scheduleDefinitionId); + } + + public Response stopWithResponse(String scheduleDefinitionId, Context context) { + return this.serviceClient().stopWithResponse(scheduleDefinitionId, context); + } + + private AccessReviewScheduleDefinitionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } + + public AccessReviewScheduleDefinitionImpl define(String name) { + return new AccessReviewScheduleDefinitionImpl(name, this.manager()); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AuthorizationManagementClientBuilder.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AuthorizationManagementClientBuilder.java new file mode 100644 index 0000000000000..c6ca7e0927815 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AuthorizationManagementClientBuilder.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the AuthorizationManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {AuthorizationManagementClientImpl.class}) +public final class AuthorizationManagementClientBuilder { + /* + * The ID of the target subscription. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the AuthorizationManagementClientBuilder. + */ + public AuthorizationManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the AuthorizationManagementClientBuilder. + */ + public AuthorizationManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the AuthorizationManagementClientBuilder. + */ + public AuthorizationManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the AuthorizationManagementClientBuilder. + */ + public AuthorizationManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the AuthorizationManagementClientBuilder. + */ + public AuthorizationManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the AuthorizationManagementClientBuilder. + */ + public AuthorizationManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of AuthorizationManagementClientImpl with the provided parameters. + * + * @return an instance of AuthorizationManagementClientImpl. + */ + public AuthorizationManagementClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = + (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval = + (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = + (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + AuthorizationManagementClientImpl client = + new AuthorizationManagementClientImpl( + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + subscriptionId, + localEndpoint); + return client; + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AuthorizationManagementClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AuthorizationManagementClientImpl.java new file mode 100644 index 0000000000000..962f67bad42ae --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AuthorizationManagementClientImpl.java @@ -0,0 +1,642 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.authorization.generated.fluent.AccessReviewDefaultSettingsOperationsClient; +import com.azure.resourcemanager.authorization.generated.fluent.AccessReviewHistoryDefinitionInstancesClient; +import com.azure.resourcemanager.authorization.generated.fluent.AccessReviewHistoryDefinitionInstancesOperationsClient; +import com.azure.resourcemanager.authorization.generated.fluent.AccessReviewHistoryDefinitionOperationsClient; +import com.azure.resourcemanager.authorization.generated.fluent.AccessReviewHistoryDefinitionsClient; +import com.azure.resourcemanager.authorization.generated.fluent.AccessReviewInstanceContactedReviewersClient; +import com.azure.resourcemanager.authorization.generated.fluent.AccessReviewInstanceDecisionsClient; +import com.azure.resourcemanager.authorization.generated.fluent.AccessReviewInstanceMyDecisionsClient; +import com.azure.resourcemanager.authorization.generated.fluent.AccessReviewInstanceOperationsClient; +import com.azure.resourcemanager.authorization.generated.fluent.AccessReviewInstancesAssignedForMyApprovalsClient; +import com.azure.resourcemanager.authorization.generated.fluent.AccessReviewInstancesClient; +import com.azure.resourcemanager.authorization.generated.fluent.AccessReviewScheduleDefinitionsAssignedForMyApprovalsClient; +import com.azure.resourcemanager.authorization.generated.fluent.AccessReviewScheduleDefinitionsClient; +import com.azure.resourcemanager.authorization.generated.fluent.AuthorizationManagementClient; +import com.azure.resourcemanager.authorization.generated.fluent.OperationsClient; +import com.azure.resourcemanager.authorization.generated.fluent.ScopeAccessReviewDefaultSettingsClient; +import com.azure.resourcemanager.authorization.generated.fluent.ScopeAccessReviewHistoryDefinitionInstancesClient; +import com.azure.resourcemanager.authorization.generated.fluent.ScopeAccessReviewHistoryDefinitionInstancesOperationsClient; +import com.azure.resourcemanager.authorization.generated.fluent.ScopeAccessReviewHistoryDefinitionOperationsClient; +import com.azure.resourcemanager.authorization.generated.fluent.ScopeAccessReviewHistoryDefinitionsClient; +import com.azure.resourcemanager.authorization.generated.fluent.ScopeAccessReviewInstanceContactedReviewersClient; +import com.azure.resourcemanager.authorization.generated.fluent.ScopeAccessReviewInstanceDecisionsClient; +import com.azure.resourcemanager.authorization.generated.fluent.ScopeAccessReviewInstanceOperationsClient; +import com.azure.resourcemanager.authorization.generated.fluent.ScopeAccessReviewInstancesClient; +import com.azure.resourcemanager.authorization.generated.fluent.ScopeAccessReviewScheduleDefinitionsClient; +import com.azure.resourcemanager.authorization.generated.fluent.TenantLevelAccessReviewInstanceContactedReviewersClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the AuthorizationManagementClientImpl type. */ +@ServiceClient(builder = AuthorizationManagementClientBuilder.class) +public final class AuthorizationManagementClientImpl implements AuthorizationManagementClient { + /** The ID of the target subscription. */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The AccessReviewHistoryDefinitionsClient object to access its operations. */ + private final AccessReviewHistoryDefinitionsClient accessReviewHistoryDefinitions; + + /** + * Gets the AccessReviewHistoryDefinitionsClient object to access its operations. + * + * @return the AccessReviewHistoryDefinitionsClient object. + */ + public AccessReviewHistoryDefinitionsClient getAccessReviewHistoryDefinitions() { + return this.accessReviewHistoryDefinitions; + } + + /** The AccessReviewHistoryDefinitionOperationsClient object to access its operations. */ + private final AccessReviewHistoryDefinitionOperationsClient accessReviewHistoryDefinitionOperations; + + /** + * Gets the AccessReviewHistoryDefinitionOperationsClient object to access its operations. + * + * @return the AccessReviewHistoryDefinitionOperationsClient object. + */ + public AccessReviewHistoryDefinitionOperationsClient getAccessReviewHistoryDefinitionOperations() { + return this.accessReviewHistoryDefinitionOperations; + } + + /** The AccessReviewHistoryDefinitionInstancesClient object to access its operations. */ + private final AccessReviewHistoryDefinitionInstancesClient accessReviewHistoryDefinitionInstances; + + /** + * Gets the AccessReviewHistoryDefinitionInstancesClient object to access its operations. + * + * @return the AccessReviewHistoryDefinitionInstancesClient object. + */ + public AccessReviewHistoryDefinitionInstancesClient getAccessReviewHistoryDefinitionInstances() { + return this.accessReviewHistoryDefinitionInstances; + } + + /** The AccessReviewHistoryDefinitionInstancesOperationsClient object to access its operations. */ + private final AccessReviewHistoryDefinitionInstancesOperationsClient + accessReviewHistoryDefinitionInstancesOperations; + + /** + * Gets the AccessReviewHistoryDefinitionInstancesOperationsClient object to access its operations. + * + * @return the AccessReviewHistoryDefinitionInstancesOperationsClient object. + */ + public AccessReviewHistoryDefinitionInstancesOperationsClient + getAccessReviewHistoryDefinitionInstancesOperations() { + return this.accessReviewHistoryDefinitionInstancesOperations; + } + + /** The AccessReviewScheduleDefinitionsClient object to access its operations. */ + private final AccessReviewScheduleDefinitionsClient accessReviewScheduleDefinitions; + + /** + * Gets the AccessReviewScheduleDefinitionsClient object to access its operations. + * + * @return the AccessReviewScheduleDefinitionsClient object. + */ + public AccessReviewScheduleDefinitionsClient getAccessReviewScheduleDefinitions() { + return this.accessReviewScheduleDefinitions; + } + + /** The AccessReviewInstancesClient object to access its operations. */ + private final AccessReviewInstancesClient accessReviewInstances; + + /** + * Gets the AccessReviewInstancesClient object to access its operations. + * + * @return the AccessReviewInstancesClient object. + */ + public AccessReviewInstancesClient getAccessReviewInstances() { + return this.accessReviewInstances; + } + + /** The AccessReviewInstanceOperationsClient object to access its operations. */ + private final AccessReviewInstanceOperationsClient accessReviewInstanceOperations; + + /** + * Gets the AccessReviewInstanceOperationsClient object to access its operations. + * + * @return the AccessReviewInstanceOperationsClient object. + */ + public AccessReviewInstanceOperationsClient getAccessReviewInstanceOperations() { + return this.accessReviewInstanceOperations; + } + + /** The AccessReviewInstanceDecisionsClient object to access its operations. */ + private final AccessReviewInstanceDecisionsClient accessReviewInstanceDecisions; + + /** + * Gets the AccessReviewInstanceDecisionsClient object to access its operations. + * + * @return the AccessReviewInstanceDecisionsClient object. + */ + public AccessReviewInstanceDecisionsClient getAccessReviewInstanceDecisions() { + return this.accessReviewInstanceDecisions; + } + + /** The AccessReviewInstanceContactedReviewersClient object to access its operations. */ + private final AccessReviewInstanceContactedReviewersClient accessReviewInstanceContactedReviewers; + + /** + * Gets the AccessReviewInstanceContactedReviewersClient object to access its operations. + * + * @return the AccessReviewInstanceContactedReviewersClient object. + */ + public AccessReviewInstanceContactedReviewersClient getAccessReviewInstanceContactedReviewers() { + return this.accessReviewInstanceContactedReviewers; + } + + /** The AccessReviewDefaultSettingsOperationsClient object to access its operations. */ + private final AccessReviewDefaultSettingsOperationsClient accessReviewDefaultSettingsOperations; + + /** + * Gets the AccessReviewDefaultSettingsOperationsClient object to access its operations. + * + * @return the AccessReviewDefaultSettingsOperationsClient object. + */ + public AccessReviewDefaultSettingsOperationsClient getAccessReviewDefaultSettingsOperations() { + return this.accessReviewDefaultSettingsOperations; + } + + /** The ScopeAccessReviewHistoryDefinitionsClient object to access its operations. */ + private final ScopeAccessReviewHistoryDefinitionsClient scopeAccessReviewHistoryDefinitions; + + /** + * Gets the ScopeAccessReviewHistoryDefinitionsClient object to access its operations. + * + * @return the ScopeAccessReviewHistoryDefinitionsClient object. + */ + public ScopeAccessReviewHistoryDefinitionsClient getScopeAccessReviewHistoryDefinitions() { + return this.scopeAccessReviewHistoryDefinitions; + } + + /** The ScopeAccessReviewHistoryDefinitionOperationsClient object to access its operations. */ + private final ScopeAccessReviewHistoryDefinitionOperationsClient scopeAccessReviewHistoryDefinitionOperations; + + /** + * Gets the ScopeAccessReviewHistoryDefinitionOperationsClient object to access its operations. + * + * @return the ScopeAccessReviewHistoryDefinitionOperationsClient object. + */ + public ScopeAccessReviewHistoryDefinitionOperationsClient getScopeAccessReviewHistoryDefinitionOperations() { + return this.scopeAccessReviewHistoryDefinitionOperations; + } + + /** The ScopeAccessReviewHistoryDefinitionInstancesClient object to access its operations. */ + private final ScopeAccessReviewHistoryDefinitionInstancesClient scopeAccessReviewHistoryDefinitionInstances; + + /** + * Gets the ScopeAccessReviewHistoryDefinitionInstancesClient object to access its operations. + * + * @return the ScopeAccessReviewHistoryDefinitionInstancesClient object. + */ + public ScopeAccessReviewHistoryDefinitionInstancesClient getScopeAccessReviewHistoryDefinitionInstances() { + return this.scopeAccessReviewHistoryDefinitionInstances; + } + + /** The ScopeAccessReviewHistoryDefinitionInstancesOperationsClient object to access its operations. */ + private final ScopeAccessReviewHistoryDefinitionInstancesOperationsClient + scopeAccessReviewHistoryDefinitionInstancesOperations; + + /** + * Gets the ScopeAccessReviewHistoryDefinitionInstancesOperationsClient object to access its operations. + * + * @return the ScopeAccessReviewHistoryDefinitionInstancesOperationsClient object. + */ + public ScopeAccessReviewHistoryDefinitionInstancesOperationsClient + getScopeAccessReviewHistoryDefinitionInstancesOperations() { + return this.scopeAccessReviewHistoryDefinitionInstancesOperations; + } + + /** The ScopeAccessReviewScheduleDefinitionsClient object to access its operations. */ + private final ScopeAccessReviewScheduleDefinitionsClient scopeAccessReviewScheduleDefinitions; + + /** + * Gets the ScopeAccessReviewScheduleDefinitionsClient object to access its operations. + * + * @return the ScopeAccessReviewScheduleDefinitionsClient object. + */ + public ScopeAccessReviewScheduleDefinitionsClient getScopeAccessReviewScheduleDefinitions() { + return this.scopeAccessReviewScheduleDefinitions; + } + + /** The ScopeAccessReviewInstancesClient object to access its operations. */ + private final ScopeAccessReviewInstancesClient scopeAccessReviewInstances; + + /** + * Gets the ScopeAccessReviewInstancesClient object to access its operations. + * + * @return the ScopeAccessReviewInstancesClient object. + */ + public ScopeAccessReviewInstancesClient getScopeAccessReviewInstances() { + return this.scopeAccessReviewInstances; + } + + /** The ScopeAccessReviewInstanceOperationsClient object to access its operations. */ + private final ScopeAccessReviewInstanceOperationsClient scopeAccessReviewInstanceOperations; + + /** + * Gets the ScopeAccessReviewInstanceOperationsClient object to access its operations. + * + * @return the ScopeAccessReviewInstanceOperationsClient object. + */ + public ScopeAccessReviewInstanceOperationsClient getScopeAccessReviewInstanceOperations() { + return this.scopeAccessReviewInstanceOperations; + } + + /** The ScopeAccessReviewInstanceDecisionsClient object to access its operations. */ + private final ScopeAccessReviewInstanceDecisionsClient scopeAccessReviewInstanceDecisions; + + /** + * Gets the ScopeAccessReviewInstanceDecisionsClient object to access its operations. + * + * @return the ScopeAccessReviewInstanceDecisionsClient object. + */ + public ScopeAccessReviewInstanceDecisionsClient getScopeAccessReviewInstanceDecisions() { + return this.scopeAccessReviewInstanceDecisions; + } + + /** The ScopeAccessReviewInstanceContactedReviewersClient object to access its operations. */ + private final ScopeAccessReviewInstanceContactedReviewersClient scopeAccessReviewInstanceContactedReviewers; + + /** + * Gets the ScopeAccessReviewInstanceContactedReviewersClient object to access its operations. + * + * @return the ScopeAccessReviewInstanceContactedReviewersClient object. + */ + public ScopeAccessReviewInstanceContactedReviewersClient getScopeAccessReviewInstanceContactedReviewers() { + return this.scopeAccessReviewInstanceContactedReviewers; + } + + /** The ScopeAccessReviewDefaultSettingsClient object to access its operations. */ + private final ScopeAccessReviewDefaultSettingsClient scopeAccessReviewDefaultSettings; + + /** + * Gets the ScopeAccessReviewDefaultSettingsClient object to access its operations. + * + * @return the ScopeAccessReviewDefaultSettingsClient object. + */ + public ScopeAccessReviewDefaultSettingsClient getScopeAccessReviewDefaultSettings() { + return this.scopeAccessReviewDefaultSettings; + } + + /** The AccessReviewScheduleDefinitionsAssignedForMyApprovalsClient object to access its operations. */ + private final AccessReviewScheduleDefinitionsAssignedForMyApprovalsClient + accessReviewScheduleDefinitionsAssignedForMyApprovals; + + /** + * Gets the AccessReviewScheduleDefinitionsAssignedForMyApprovalsClient object to access its operations. + * + * @return the AccessReviewScheduleDefinitionsAssignedForMyApprovalsClient object. + */ + public AccessReviewScheduleDefinitionsAssignedForMyApprovalsClient + getAccessReviewScheduleDefinitionsAssignedForMyApprovals() { + return this.accessReviewScheduleDefinitionsAssignedForMyApprovals; + } + + /** The AccessReviewInstancesAssignedForMyApprovalsClient object to access its operations. */ + private final AccessReviewInstancesAssignedForMyApprovalsClient accessReviewInstancesAssignedForMyApprovals; + + /** + * Gets the AccessReviewInstancesAssignedForMyApprovalsClient object to access its operations. + * + * @return the AccessReviewInstancesAssignedForMyApprovalsClient object. + */ + public AccessReviewInstancesAssignedForMyApprovalsClient getAccessReviewInstancesAssignedForMyApprovals() { + return this.accessReviewInstancesAssignedForMyApprovals; + } + + /** The AccessReviewInstanceMyDecisionsClient object to access its operations. */ + private final AccessReviewInstanceMyDecisionsClient accessReviewInstanceMyDecisions; + + /** + * Gets the AccessReviewInstanceMyDecisionsClient object to access its operations. + * + * @return the AccessReviewInstanceMyDecisionsClient object. + */ + public AccessReviewInstanceMyDecisionsClient getAccessReviewInstanceMyDecisions() { + return this.accessReviewInstanceMyDecisions; + } + + /** The TenantLevelAccessReviewInstanceContactedReviewersClient object to access its operations. */ + private final TenantLevelAccessReviewInstanceContactedReviewersClient + tenantLevelAccessReviewInstanceContactedReviewers; + + /** + * Gets the TenantLevelAccessReviewInstanceContactedReviewersClient object to access its operations. + * + * @return the TenantLevelAccessReviewInstanceContactedReviewersClient object. + */ + public TenantLevelAccessReviewInstanceContactedReviewersClient + getTenantLevelAccessReviewInstanceContactedReviewers() { + return this.tenantLevelAccessReviewInstanceContactedReviewers; + } + + /** + * Initializes an instance of AuthorizationManagementClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId The ID of the target subscription. + * @param endpoint server parameter. + */ + AuthorizationManagementClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2021-12-01-preview"; + this.operations = new OperationsClientImpl(this); + this.accessReviewHistoryDefinitions = new AccessReviewHistoryDefinitionsClientImpl(this); + this.accessReviewHistoryDefinitionOperations = new AccessReviewHistoryDefinitionOperationsClientImpl(this); + this.accessReviewHistoryDefinitionInstances = new AccessReviewHistoryDefinitionInstancesClientImpl(this); + this.accessReviewHistoryDefinitionInstancesOperations = + new AccessReviewHistoryDefinitionInstancesOperationsClientImpl(this); + this.accessReviewScheduleDefinitions = new AccessReviewScheduleDefinitionsClientImpl(this); + this.accessReviewInstances = new AccessReviewInstancesClientImpl(this); + this.accessReviewInstanceOperations = new AccessReviewInstanceOperationsClientImpl(this); + this.accessReviewInstanceDecisions = new AccessReviewInstanceDecisionsClientImpl(this); + this.accessReviewInstanceContactedReviewers = new AccessReviewInstanceContactedReviewersClientImpl(this); + this.accessReviewDefaultSettingsOperations = new AccessReviewDefaultSettingsOperationsClientImpl(this); + this.scopeAccessReviewHistoryDefinitions = new ScopeAccessReviewHistoryDefinitionsClientImpl(this); + this.scopeAccessReviewHistoryDefinitionOperations = + new ScopeAccessReviewHistoryDefinitionOperationsClientImpl(this); + this.scopeAccessReviewHistoryDefinitionInstances = + new ScopeAccessReviewHistoryDefinitionInstancesClientImpl(this); + this.scopeAccessReviewHistoryDefinitionInstancesOperations = + new ScopeAccessReviewHistoryDefinitionInstancesOperationsClientImpl(this); + this.scopeAccessReviewScheduleDefinitions = new ScopeAccessReviewScheduleDefinitionsClientImpl(this); + this.scopeAccessReviewInstances = new ScopeAccessReviewInstancesClientImpl(this); + this.scopeAccessReviewInstanceOperations = new ScopeAccessReviewInstanceOperationsClientImpl(this); + this.scopeAccessReviewInstanceDecisions = new ScopeAccessReviewInstanceDecisionsClientImpl(this); + this.scopeAccessReviewInstanceContactedReviewers = + new ScopeAccessReviewInstanceContactedReviewersClientImpl(this); + this.scopeAccessReviewDefaultSettings = new ScopeAccessReviewDefaultSettingsClientImpl(this); + this.accessReviewScheduleDefinitionsAssignedForMyApprovals = + new AccessReviewScheduleDefinitionsAssignedForMyApprovalsClientImpl(this); + this.accessReviewInstancesAssignedForMyApprovals = + new AccessReviewInstancesAssignedForMyApprovalsClientImpl(this); + this.accessReviewInstanceMyDecisions = new AccessReviewInstanceMyDecisionsClientImpl(this); + this.tenantLevelAccessReviewInstanceContactedReviewers = + new TenantLevelAccessReviewInstanceContactedReviewersClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + return CoreUtils.mergeContexts(this.getContext(), context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AuthorizationManagementClientImpl.class); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/OperationImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/OperationImpl.java new file mode 100644 index 0000000000000..105fd71fa5533 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/OperationImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.resourcemanager.authorization.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.authorization.generated.models.Operation; +import com.azure.resourcemanager.authorization.generated.models.OperationDisplay; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + OperationImpl( + OperationInner innerObject, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public String origin() { + return this.innerModel().origin(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/OperationsClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..9600f1cb6464f --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/OperationsClientImpl.java @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.authorization.generated.fluent.OperationsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.authorization.generated.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AuthorizationManagementClientOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Authorization/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists the operations available from this provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list Microsoft.Authorization operations along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the operations available from this provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list Microsoft.Authorization operations along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the operations available from this provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list Microsoft.Authorization operations as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the operations available from this provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list Microsoft.Authorization operations as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the operations available from this provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list Microsoft.Authorization operations as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists the operations available from this provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list Microsoft.Authorization operations as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list Microsoft.Authorization operations along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list Microsoft.Authorization operations along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/OperationsImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..bf4e61234fed2 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/OperationsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.authorization.generated.fluent.OperationsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.authorization.generated.models.Operation; +import com.azure.resourcemanager.authorization.generated.models.Operations; + +public final class OperationsImpl implements Operations { + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewDefaultSettingsClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewDefaultSettingsClientImpl.java new file mode 100644 index 0000000000000..46f6835dfe57f --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewDefaultSettingsClientImpl.java @@ -0,0 +1,303 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.authorization.generated.fluent.ScopeAccessReviewDefaultSettingsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewDefaultSettingsInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewScheduleSettings; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ScopeAccessReviewDefaultSettingsClient. + */ +public final class ScopeAccessReviewDefaultSettingsClientImpl implements ScopeAccessReviewDefaultSettingsClient { + /** The proxy service used to perform REST calls. */ + private final ScopeAccessReviewDefaultSettingsService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of ScopeAccessReviewDefaultSettingsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ScopeAccessReviewDefaultSettingsClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy + .create( + ScopeAccessReviewDefaultSettingsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AuthorizationManagementClientScopeAccessReviewDefaultSettings to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + private interface ScopeAccessReviewDefaultSettingsService { + @Headers({"Content-Type: application/json"}) + @Get("/{scope}/providers/Microsoft.Authorization/accessReviewScheduleSettings/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("scope") String scope, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put("/{scope}/providers/Microsoft.Authorization/accessReviewScheduleSettings/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> put( + @HostParam("$host") String endpoint, + @PathParam("scope") String scope, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AccessReviewScheduleSettings properties, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get access review default settings for the subscription. + * + * @param scope The scope of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review default settings for the subscription along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String scope) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.get(this.client.getEndpoint(), scope, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get access review default settings for the subscription. + * + * @param scope The scope of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review default settings for the subscription along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String scope, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), scope, this.client.getApiVersion(), accept, context); + } + + /** + * Get access review default settings for the subscription. + * + * @param scope The scope of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review default settings for the subscription on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String scope) { + return getWithResponseAsync(scope).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get access review default settings for the subscription. + * + * @param scope The scope of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review default settings for the subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessReviewDefaultSettingsInner get(String scope) { + return getAsync(scope).block(); + } + + /** + * Get access review default settings for the subscription. + * + * @param scope The scope of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review default settings for the subscription along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String scope, Context context) { + return getWithResponseAsync(scope, context).block(); + } + + /** + * Get access review default settings for the subscription. + * + * @param scope The scope of the resource. + * @param properties Access review schedule settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review default settings for the subscription along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putWithResponseAsync( + String scope, AccessReviewScheduleSettings properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .put( + this.client.getEndpoint(), scope, this.client.getApiVersion(), properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get access review default settings for the subscription. + * + * @param scope The scope of the resource. + * @param properties Access review schedule settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review default settings for the subscription along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putWithResponseAsync( + String scope, AccessReviewScheduleSettings properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.put(this.client.getEndpoint(), scope, this.client.getApiVersion(), properties, accept, context); + } + + /** + * Get access review default settings for the subscription. + * + * @param scope The scope of the resource. + * @param properties Access review schedule settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review default settings for the subscription on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putAsync(String scope, AccessReviewScheduleSettings properties) { + return putWithResponseAsync(scope, properties).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get access review default settings for the subscription. + * + * @param scope The scope of the resource. + * @param properties Access review schedule settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review default settings for the subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessReviewDefaultSettingsInner put(String scope, AccessReviewScheduleSettings properties) { + return putAsync(scope, properties).block(); + } + + /** + * Get access review default settings for the subscription. + * + * @param scope The scope of the resource. + * @param properties Access review schedule settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review default settings for the subscription along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse( + String scope, AccessReviewScheduleSettings properties, Context context) { + return putWithResponseAsync(scope, properties, context).block(); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewDefaultSettingsImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewDefaultSettingsImpl.java new file mode 100644 index 0000000000000..e5eca8271cdd3 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewDefaultSettingsImpl.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.authorization.generated.fluent.ScopeAccessReviewDefaultSettingsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewDefaultSettingsInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewScheduleSettings; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewDefaultSettings; +import com.azure.resourcemanager.authorization.generated.models.ScopeAccessReviewDefaultSettings; + +public final class ScopeAccessReviewDefaultSettingsImpl implements ScopeAccessReviewDefaultSettings { + private static final ClientLogger LOGGER = new ClientLogger(ScopeAccessReviewDefaultSettingsImpl.class); + + private final ScopeAccessReviewDefaultSettingsClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public ScopeAccessReviewDefaultSettingsImpl( + ScopeAccessReviewDefaultSettingsClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public AccessReviewDefaultSettings get(String scope) { + AccessReviewDefaultSettingsInner inner = this.serviceClient().get(scope); + if (inner != null) { + return new AccessReviewDefaultSettingsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String scope, Context context) { + Response inner = this.serviceClient().getWithResponse(scope, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AccessReviewDefaultSettingsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AccessReviewDefaultSettings put(String scope, AccessReviewScheduleSettings properties) { + AccessReviewDefaultSettingsInner inner = this.serviceClient().put(scope, properties); + if (inner != null) { + return new AccessReviewDefaultSettingsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response putWithResponse( + String scope, AccessReviewScheduleSettings properties, Context context) { + Response inner = + this.serviceClient().putWithResponse(scope, properties, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AccessReviewDefaultSettingsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ScopeAccessReviewDefaultSettingsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewHistoryDefinitionInstancesClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewHistoryDefinitionInstancesClientImpl.java new file mode 100644 index 0000000000000..8a9ee293d2bf0 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewHistoryDefinitionInstancesClientImpl.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.authorization.generated.fluent.ScopeAccessReviewHistoryDefinitionInstancesClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryInstanceInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * ScopeAccessReviewHistoryDefinitionInstancesClient. + */ +public final class ScopeAccessReviewHistoryDefinitionInstancesClientImpl + implements ScopeAccessReviewHistoryDefinitionInstancesClient { + /** The proxy service used to perform REST calls. */ + private final ScopeAccessReviewHistoryDefinitionInstancesService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of ScopeAccessReviewHistoryDefinitionInstancesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ScopeAccessReviewHistoryDefinitionInstancesClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy + .create( + ScopeAccessReviewHistoryDefinitionInstancesService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * AuthorizationManagementClientScopeAccessReviewHistoryDefinitionInstances to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + private interface ScopeAccessReviewHistoryDefinitionInstancesService { + @Headers({"Content-Type: application/json"}) + @Post( + "/{scope}/providers/Microsoft.Authorization/accessReviewHistoryDefinitions/{historyDefinitionId}/instances" + + "/{instanceId}/generateDownloadUri") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> generateDownloadUri( + @HostParam("$host") String endpoint, + @PathParam("scope") String scope, + @PathParam("historyDefinitionId") String historyDefinitionId, + @PathParam("instanceId") String instanceId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 scope The scope of the resource. + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review History Definition Instance along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> generateDownloadUriWithResponseAsync( + String scope, String historyDefinitionId, String instanceId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (historyDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter historyDefinitionId is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .generateDownloadUri( + this.client.getEndpoint(), + scope, + historyDefinitionId, + instanceId, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 scope The scope of the resource. + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review History Definition Instance along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> generateDownloadUriWithResponseAsync( + String scope, String historyDefinitionId, String instanceId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (historyDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter historyDefinitionId is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .generateDownloadUri( + this.client.getEndpoint(), + scope, + historyDefinitionId, + instanceId, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 scope The scope of the resource. + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review History Definition Instance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generateDownloadUriAsync( + String scope, String historyDefinitionId, String instanceId) { + return generateDownloadUriWithResponseAsync(scope, historyDefinitionId, instanceId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 scope The scope of the resource. + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review History Definition Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessReviewHistoryInstanceInner generateDownloadUri( + String scope, String historyDefinitionId, String instanceId) { + return generateDownloadUriAsync(scope, historyDefinitionId, instanceId).block(); + } + + /** + * 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 scope The scope of the resource. + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review History Definition Instance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response generateDownloadUriWithResponse( + String scope, String historyDefinitionId, String instanceId, Context context) { + return generateDownloadUriWithResponseAsync(scope, historyDefinitionId, instanceId, context).block(); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewHistoryDefinitionInstancesImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewHistoryDefinitionInstancesImpl.java new file mode 100644 index 0000000000000..f12f257e2c6bb --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewHistoryDefinitionInstancesImpl.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.authorization.generated.fluent.ScopeAccessReviewHistoryDefinitionInstancesClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryInstanceInner; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewHistoryInstance; +import com.azure.resourcemanager.authorization.generated.models.ScopeAccessReviewHistoryDefinitionInstances; + +public final class ScopeAccessReviewHistoryDefinitionInstancesImpl + implements ScopeAccessReviewHistoryDefinitionInstances { + private static final ClientLogger LOGGER = new ClientLogger(ScopeAccessReviewHistoryDefinitionInstancesImpl.class); + + private final ScopeAccessReviewHistoryDefinitionInstancesClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public ScopeAccessReviewHistoryDefinitionInstancesImpl( + ScopeAccessReviewHistoryDefinitionInstancesClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public AccessReviewHistoryInstance generateDownloadUri( + String scope, String historyDefinitionId, String instanceId) { + AccessReviewHistoryInstanceInner inner = + this.serviceClient().generateDownloadUri(scope, historyDefinitionId, instanceId); + if (inner != null) { + return new AccessReviewHistoryInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response generateDownloadUriWithResponse( + String scope, String historyDefinitionId, String instanceId, Context context) { + Response inner = + this.serviceClient().generateDownloadUriWithResponse(scope, historyDefinitionId, instanceId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AccessReviewHistoryInstanceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ScopeAccessReviewHistoryDefinitionInstancesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewHistoryDefinitionInstancesOperationsClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewHistoryDefinitionInstancesOperationsClientImpl.java new file mode 100644 index 0000000000000..3dc080af8fecf --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewHistoryDefinitionInstancesOperationsClientImpl.java @@ -0,0 +1,330 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.authorization.generated.fluent.ScopeAccessReviewHistoryDefinitionInstancesOperationsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryInstanceInner; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewHistoryDefinitionInstanceListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * ScopeAccessReviewHistoryDefinitionInstancesOperationsClient. + */ +public final class ScopeAccessReviewHistoryDefinitionInstancesOperationsClientImpl + implements ScopeAccessReviewHistoryDefinitionInstancesOperationsClient { + /** The proxy service used to perform REST calls. */ + private final ScopeAccessReviewHistoryDefinitionInstancesOperationsService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of ScopeAccessReviewHistoryDefinitionInstancesOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ScopeAccessReviewHistoryDefinitionInstancesOperationsClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy + .create( + ScopeAccessReviewHistoryDefinitionInstancesOperationsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * AuthorizationManagementClientScopeAccessReviewHistoryDefinitionInstancesOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + private interface ScopeAccessReviewHistoryDefinitionInstancesOperationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/{scope}/providers/Microsoft.Authorization/accessReviewHistoryDefinitions/{historyDefinitionId}/instances") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("scope") String scope, + @PathParam("historyDefinitionId") String historyDefinitionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get access review history definition instances by definition Id. + * + * @param scope The scope of the resource. + * @param historyDefinitionId The id of the access review history definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review history definition instances by definition Id along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String scope, String historyDefinitionId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (historyDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter historyDefinitionId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + scope, + historyDefinitionId, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get access review history definition instances by definition Id. + * + * @param scope The scope of the resource. + * @param historyDefinitionId The id of the access review history definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review history definition instances by definition Id along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String scope, String historyDefinitionId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (historyDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter historyDefinitionId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), scope, historyDefinitionId, this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get access review history definition instances by definition Id. + * + * @param scope The scope of the resource. + * @param historyDefinitionId The id of the access review history definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review history definition instances by definition Id as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String scope, String historyDefinitionId) { + return new PagedFlux<>( + () -> listSinglePageAsync(scope, historyDefinitionId), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get access review history definition instances by definition Id. + * + * @param scope The scope of the resource. + * @param historyDefinitionId The id of the access review history definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review history definition instances by definition Id as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String scope, String historyDefinitionId, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(scope, historyDefinitionId, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get access review history definition instances by definition Id. + * + * @param scope The scope of the resource. + * @param historyDefinitionId The id of the access review history definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review history definition instances by definition Id as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String scope, String historyDefinitionId) { + return new PagedIterable<>(listAsync(scope, historyDefinitionId)); + } + + /** + * Get access review history definition instances by definition Id. + * + * @param scope The scope of the resource. + * @param historyDefinitionId The id of the access review history definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review history definition instances by definition Id as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String scope, String historyDefinitionId, Context context) { + return new PagedIterable<>(listAsync(scope, historyDefinitionId, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review History Instances along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review History Instances along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewHistoryDefinitionInstancesOperationsImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewHistoryDefinitionInstancesOperationsImpl.java new file mode 100644 index 0000000000000..4db2f32cb6402 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewHistoryDefinitionInstancesOperationsImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.authorization.generated.fluent.ScopeAccessReviewHistoryDefinitionInstancesOperationsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryInstanceInner; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewHistoryInstance; +import com.azure.resourcemanager.authorization.generated.models.ScopeAccessReviewHistoryDefinitionInstancesOperations; + +public final class ScopeAccessReviewHistoryDefinitionInstancesOperationsImpl + implements ScopeAccessReviewHistoryDefinitionInstancesOperations { + private static final ClientLogger LOGGER = + new ClientLogger(ScopeAccessReviewHistoryDefinitionInstancesOperationsImpl.class); + + private final ScopeAccessReviewHistoryDefinitionInstancesOperationsClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public ScopeAccessReviewHistoryDefinitionInstancesOperationsImpl( + ScopeAccessReviewHistoryDefinitionInstancesOperationsClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String scope, String historyDefinitionId) { + PagedIterable inner = this.serviceClient().list(scope, historyDefinitionId); + return Utils.mapPage(inner, inner1 -> new AccessReviewHistoryInstanceImpl(inner1, this.manager())); + } + + public PagedIterable list(String scope, String historyDefinitionId, Context context) { + PagedIterable inner = + this.serviceClient().list(scope, historyDefinitionId, context); + return Utils.mapPage(inner, inner1 -> new AccessReviewHistoryInstanceImpl(inner1, this.manager())); + } + + private ScopeAccessReviewHistoryDefinitionInstancesOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewHistoryDefinitionOperationsClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewHistoryDefinitionOperationsClientImpl.java new file mode 100644 index 0000000000000..ac683f9f0c84e --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewHistoryDefinitionOperationsClientImpl.java @@ -0,0 +1,357 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.authorization.generated.fluent.ScopeAccessReviewHistoryDefinitionOperationsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryDefinitionInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryDefinitionProperties; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * ScopeAccessReviewHistoryDefinitionOperationsClient. + */ +public final class ScopeAccessReviewHistoryDefinitionOperationsClientImpl + implements ScopeAccessReviewHistoryDefinitionOperationsClient { + /** The proxy service used to perform REST calls. */ + private final ScopeAccessReviewHistoryDefinitionOperationsService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of ScopeAccessReviewHistoryDefinitionOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ScopeAccessReviewHistoryDefinitionOperationsClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy + .create( + ScopeAccessReviewHistoryDefinitionOperationsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * AuthorizationManagementClientScopeAccessReviewHistoryDefinitionOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + private interface ScopeAccessReviewHistoryDefinitionOperationsService { + @Headers({"Content-Type: application/json"}) + @Put("/{scope}/providers/Microsoft.Authorization/accessReviewHistoryDefinitions/{historyDefinitionId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam("scope") String scope, + @PathParam("historyDefinitionId") String historyDefinitionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AccessReviewHistoryDefinitionProperties properties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete("/{scope}/providers/Microsoft.Authorization/accessReviewHistoryDefinitions/{historyDefinitionId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> deleteById( + @HostParam("$host") String endpoint, + @PathParam("scope") String scope, + @PathParam("historyDefinitionId") String historyDefinitionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Create a scheduled or one-time Access Review History Definition. + * + * @param scope The scope of the resource. + * @param historyDefinitionId The id of the access review history definition. + * @param properties Access review history definition properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review History Definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String scope, String historyDefinitionId, AccessReviewHistoryDefinitionProperties properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (historyDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter historyDefinitionId is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + scope, + historyDefinitionId, + this.client.getApiVersion(), + properties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a scheduled or one-time Access Review History Definition. + * + * @param scope The scope of the resource. + * @param historyDefinitionId The id of the access review history definition. + * @param properties Access review history definition properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review History Definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String scope, String historyDefinitionId, AccessReviewHistoryDefinitionProperties properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (historyDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter historyDefinitionId is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + scope, + historyDefinitionId, + this.client.getApiVersion(), + properties, + accept, + context); + } + + /** + * Create a scheduled or one-time Access Review History Definition. + * + * @param scope The scope of the resource. + * @param historyDefinitionId The id of the access review history definition. + * @param properties Access review history definition properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review History Definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String scope, String historyDefinitionId, AccessReviewHistoryDefinitionProperties properties) { + return createWithResponseAsync(scope, historyDefinitionId, properties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create a scheduled or one-time Access Review History Definition. + * + * @param scope The scope of the resource. + * @param historyDefinitionId The id of the access review history definition. + * @param properties Access review history definition properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review History Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessReviewHistoryDefinitionInner create( + String scope, String historyDefinitionId, AccessReviewHistoryDefinitionProperties properties) { + return createAsync(scope, historyDefinitionId, properties).block(); + } + + /** + * Create a scheduled or one-time Access Review History Definition. + * + * @param scope The scope of the resource. + * @param historyDefinitionId The id of the access review history definition. + * @param properties Access review history definition properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review History Definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String scope, String historyDefinitionId, AccessReviewHistoryDefinitionProperties properties, Context context) { + return createWithResponseAsync(scope, historyDefinitionId, properties, context).block(); + } + + /** + * Delete an access review history definition. + * + * @param scope The scope of the resource. + * @param historyDefinitionId The id of the access review history definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteByIdWithResponseAsync(String scope, String historyDefinitionId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (historyDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter historyDefinitionId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteById( + this.client.getEndpoint(), + scope, + historyDefinitionId, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete an access review history definition. + * + * @param scope The scope of the resource. + * @param historyDefinitionId The id of the access review history definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteByIdWithResponseAsync( + String scope, String historyDefinitionId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (historyDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter historyDefinitionId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteById( + this.client.getEndpoint(), scope, historyDefinitionId, this.client.getApiVersion(), accept, context); + } + + /** + * Delete an access review history definition. + * + * @param scope The scope of the resource. + * @param historyDefinitionId The id of the access review history definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteByIdAsync(String scope, String historyDefinitionId) { + return deleteByIdWithResponseAsync(scope, historyDefinitionId).flatMap(ignored -> Mono.empty()); + } + + /** + * Delete an access review history definition. + * + * @param scope The scope of the resource. + * @param historyDefinitionId The id of the access review history definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteById(String scope, String historyDefinitionId) { + deleteByIdAsync(scope, historyDefinitionId).block(); + } + + /** + * Delete an access review history definition. + * + * @param scope The scope of the resource. + * @param historyDefinitionId The id of the access review history definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteByIdWithResponse(String scope, String historyDefinitionId, Context context) { + return deleteByIdWithResponseAsync(scope, historyDefinitionId, context).block(); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewHistoryDefinitionOperationsImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewHistoryDefinitionOperationsImpl.java new file mode 100644 index 0000000000000..859f3f685537f --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewHistoryDefinitionOperationsImpl.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.authorization.generated.fluent.ScopeAccessReviewHistoryDefinitionOperationsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryDefinitionInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryDefinitionProperties; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewHistoryDefinition; +import com.azure.resourcemanager.authorization.generated.models.ScopeAccessReviewHistoryDefinitionOperations; + +public final class ScopeAccessReviewHistoryDefinitionOperationsImpl + implements ScopeAccessReviewHistoryDefinitionOperations { + private static final ClientLogger LOGGER = new ClientLogger(ScopeAccessReviewHistoryDefinitionOperationsImpl.class); + + private final ScopeAccessReviewHistoryDefinitionOperationsClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public ScopeAccessReviewHistoryDefinitionOperationsImpl( + ScopeAccessReviewHistoryDefinitionOperationsClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public AccessReviewHistoryDefinition create( + String scope, String historyDefinitionId, AccessReviewHistoryDefinitionProperties properties) { + AccessReviewHistoryDefinitionInner inner = this.serviceClient().create(scope, historyDefinitionId, properties); + if (inner != null) { + return new AccessReviewHistoryDefinitionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createWithResponse( + String scope, String historyDefinitionId, AccessReviewHistoryDefinitionProperties properties, Context context) { + Response inner = + this.serviceClient().createWithResponse(scope, historyDefinitionId, properties, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AccessReviewHistoryDefinitionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteById(String scope, String historyDefinitionId) { + this.serviceClient().deleteById(scope, historyDefinitionId); + } + + public Response deleteByIdWithResponse(String scope, String historyDefinitionId, Context context) { + return this.serviceClient().deleteByIdWithResponse(scope, historyDefinitionId, context); + } + + private ScopeAccessReviewHistoryDefinitionOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewHistoryDefinitionsClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewHistoryDefinitionsClientImpl.java new file mode 100644 index 0000000000000..77b7165576965 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewHistoryDefinitionsClientImpl.java @@ -0,0 +1,468 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.authorization.generated.fluent.ScopeAccessReviewHistoryDefinitionsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryDefinitionInner; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewHistoryDefinitionListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ScopeAccessReviewHistoryDefinitionsClient. + */ +public final class ScopeAccessReviewHistoryDefinitionsClientImpl implements ScopeAccessReviewHistoryDefinitionsClient { + /** The proxy service used to perform REST calls. */ + private final ScopeAccessReviewHistoryDefinitionsService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of ScopeAccessReviewHistoryDefinitionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ScopeAccessReviewHistoryDefinitionsClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy + .create( + ScopeAccessReviewHistoryDefinitionsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AuthorizationManagementClientScopeAccessReviewHistoryDefinitions to + * be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + private interface ScopeAccessReviewHistoryDefinitionsService { + @Headers({"Content-Type: application/json"}) + @Get("/{scope}/providers/Microsoft.Authorization/accessReviewHistoryDefinitions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("scope") String scope, + @QueryParam("api-version") String apiVersion, + @QueryParam(value = "$filter", encoded = true) String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/{scope}/providers/Microsoft.Authorization/accessReviewHistoryDefinitions/{historyDefinitionId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getById( + @HostParam("$host") String endpoint, + @PathParam("scope") String scope, + @PathParam("historyDefinitionId") String historyDefinitionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available + * for 30 days after creation. + * + * @param scope The scope of the resource. + * @param filter The filter to apply on the operation. Only standard filters on definition name and created date are + * supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review History Definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String scope, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), scope, this.client.getApiVersion(), filter, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available + * for 30 days after creation. + * + * @param scope The scope of the resource. + * @param filter The filter to apply on the operation. Only standard filters on definition name and created date are + * supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review History Definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String scope, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), scope, this.client.getApiVersion(), filter, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available + * for 30 days after creation. + * + * @param scope The scope of the resource. + * @param filter The filter to apply on the operation. Only standard filters on definition name and created date are + * supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review History Definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String scope, String filter) { + return new PagedFlux<>(() -> listSinglePageAsync(scope, filter), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available + * for 30 days after creation. + * + * @param scope The scope of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review History Definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String scope) { + final String filter = null; + return new PagedFlux<>(() -> listSinglePageAsync(scope, filter), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available + * for 30 days after creation. + * + * @param scope The scope of the resource. + * @param filter The filter to apply on the operation. Only standard filters on definition name and created date are + * supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review History Definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String scope, String filter, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(scope, filter, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available + * for 30 days after creation. + * + * @param scope The scope of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review History Definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String scope) { + final String filter = null; + return new PagedIterable<>(listAsync(scope, filter)); + } + + /** + * Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available + * for 30 days after creation. + * + * @param scope The scope of the resource. + * @param filter The filter to apply on the operation. Only standard filters on definition name and created date are + * supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review History Definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String scope, String filter, Context context) { + return new PagedIterable<>(listAsync(scope, filter, context)); + } + + /** + * Get access review history definition by definition Id. + * + * @param scope The scope of the resource. + * @param historyDefinitionId The id of the access review history definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review history definition by definition Id along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByIdWithResponseAsync( + String scope, String historyDefinitionId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (historyDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter historyDefinitionId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getById( + this.client.getEndpoint(), + scope, + historyDefinitionId, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get access review history definition by definition Id. + * + * @param scope The scope of the resource. + * @param historyDefinitionId The id of the access review history definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review history definition by definition Id along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByIdWithResponseAsync( + String scope, String historyDefinitionId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (historyDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter historyDefinitionId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getById( + this.client.getEndpoint(), scope, historyDefinitionId, this.client.getApiVersion(), accept, context); + } + + /** + * Get access review history definition by definition Id. + * + * @param scope The scope of the resource. + * @param historyDefinitionId The id of the access review history definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review history definition by definition Id on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByIdAsync(String scope, String historyDefinitionId) { + return getByIdWithResponseAsync(scope, historyDefinitionId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get access review history definition by definition Id. + * + * @param scope The scope of the resource. + * @param historyDefinitionId The id of the access review history definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review history definition by definition Id. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessReviewHistoryDefinitionInner getById(String scope, String historyDefinitionId) { + return getByIdAsync(scope, historyDefinitionId).block(); + } + + /** + * Get access review history definition by definition Id. + * + * @param scope The scope of the resource. + * @param historyDefinitionId The id of the access review history definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review history definition by definition Id along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByIdWithResponse( + String scope, String historyDefinitionId, Context context) { + return getByIdWithResponseAsync(scope, historyDefinitionId, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review History Definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review History Definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewHistoryDefinitionsImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewHistoryDefinitionsImpl.java new file mode 100644 index 0000000000000..efe6113e053f4 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewHistoryDefinitionsImpl.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.authorization.generated.fluent.ScopeAccessReviewHistoryDefinitionsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryDefinitionInner; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewHistoryDefinition; +import com.azure.resourcemanager.authorization.generated.models.ScopeAccessReviewHistoryDefinitions; + +public final class ScopeAccessReviewHistoryDefinitionsImpl implements ScopeAccessReviewHistoryDefinitions { + private static final ClientLogger LOGGER = new ClientLogger(ScopeAccessReviewHistoryDefinitionsImpl.class); + + private final ScopeAccessReviewHistoryDefinitionsClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public ScopeAccessReviewHistoryDefinitionsImpl( + ScopeAccessReviewHistoryDefinitionsClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String scope) { + PagedIterable inner = this.serviceClient().list(scope); + return Utils.mapPage(inner, inner1 -> new AccessReviewHistoryDefinitionImpl(inner1, this.manager())); + } + + public PagedIterable list(String scope, String filter, Context context) { + PagedIterable inner = this.serviceClient().list(scope, filter, context); + return Utils.mapPage(inner, inner1 -> new AccessReviewHistoryDefinitionImpl(inner1, this.manager())); + } + + public AccessReviewHistoryDefinition getById(String scope, String historyDefinitionId) { + AccessReviewHistoryDefinitionInner inner = this.serviceClient().getById(scope, historyDefinitionId); + if (inner != null) { + return new AccessReviewHistoryDefinitionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByIdWithResponse( + String scope, String historyDefinitionId, Context context) { + Response inner = + this.serviceClient().getByIdWithResponse(scope, historyDefinitionId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AccessReviewHistoryDefinitionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ScopeAccessReviewHistoryDefinitionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewInstanceContactedReviewersClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewInstanceContactedReviewersClientImpl.java new file mode 100644 index 0000000000000..ba175a8e30eba --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewInstanceContactedReviewersClientImpl.java @@ -0,0 +1,352 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.authorization.generated.fluent.ScopeAccessReviewInstanceContactedReviewersClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewContactedReviewerInner; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewContactedReviewerListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * ScopeAccessReviewInstanceContactedReviewersClient. + */ +public final class ScopeAccessReviewInstanceContactedReviewersClientImpl + implements ScopeAccessReviewInstanceContactedReviewersClient { + /** The proxy service used to perform REST calls. */ + private final ScopeAccessReviewInstanceContactedReviewersService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of ScopeAccessReviewInstanceContactedReviewersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ScopeAccessReviewInstanceContactedReviewersClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy + .create( + ScopeAccessReviewInstanceContactedReviewersService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * AuthorizationManagementClientScopeAccessReviewInstanceContactedReviewers to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + private interface ScopeAccessReviewInstanceContactedReviewersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/{scope}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}" + + "/instances/{id}/contactedReviewers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("scope") String scope, + @PathParam("scheduleDefinitionId") String scheduleDefinitionId, + @PathParam("id") String id, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get access review instance contacted reviewers. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance contacted reviewers along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String scope, String scheduleDefinitionId, String id) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + scope, + scheduleDefinitionId, + id, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get access review instance contacted reviewers. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance contacted reviewers along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String scope, String scheduleDefinitionId, String id, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + scope, + scheduleDefinitionId, + id, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get access review instance contacted reviewers. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance contacted reviewers as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String scope, String scheduleDefinitionId, String id) { + return new PagedFlux<>( + () -> listSinglePageAsync(scope, scheduleDefinitionId, id), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get access review instance contacted reviewers. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance contacted reviewers as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String scope, String scheduleDefinitionId, String id, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(scope, scheduleDefinitionId, id, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get access review instance contacted reviewers. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance contacted reviewers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String scope, String scheduleDefinitionId, String id) { + return new PagedIterable<>(listAsync(scope, scheduleDefinitionId, id)); + } + + /** + * Get access review instance contacted reviewers. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance contacted reviewers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String scope, String scheduleDefinitionId, String id, Context context) { + return new PagedIterable<>(listAsync(scope, scheduleDefinitionId, id, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of access review contacted reviewers along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of access review contacted reviewers along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewInstanceContactedReviewersImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewInstanceContactedReviewersImpl.java new file mode 100644 index 0000000000000..159ea75badddd --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewInstanceContactedReviewersImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.authorization.generated.fluent.ScopeAccessReviewInstanceContactedReviewersClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewContactedReviewerInner; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewContactedReviewer; +import com.azure.resourcemanager.authorization.generated.models.ScopeAccessReviewInstanceContactedReviewers; + +public final class ScopeAccessReviewInstanceContactedReviewersImpl + implements ScopeAccessReviewInstanceContactedReviewers { + private static final ClientLogger LOGGER = new ClientLogger(ScopeAccessReviewInstanceContactedReviewersImpl.class); + + private final ScopeAccessReviewInstanceContactedReviewersClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public ScopeAccessReviewInstanceContactedReviewersImpl( + ScopeAccessReviewInstanceContactedReviewersClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String scope, String scheduleDefinitionId, String id) { + PagedIterable inner = + this.serviceClient().list(scope, scheduleDefinitionId, id); + return Utils.mapPage(inner, inner1 -> new AccessReviewContactedReviewerImpl(inner1, this.manager())); + } + + public PagedIterable list( + String scope, String scheduleDefinitionId, String id, Context context) { + PagedIterable inner = + this.serviceClient().list(scope, scheduleDefinitionId, id, context); + return Utils.mapPage(inner, inner1 -> new AccessReviewContactedReviewerImpl(inner1, this.manager())); + } + + private ScopeAccessReviewInstanceContactedReviewersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewInstanceDecisionsClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewInstanceDecisionsClientImpl.java new file mode 100644 index 0000000000000..d7a7c6f6f91cd --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewInstanceDecisionsClientImpl.java @@ -0,0 +1,386 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.authorization.generated.fluent.ScopeAccessReviewInstanceDecisionsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewDecisionInner; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewDecisionListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ScopeAccessReviewInstanceDecisionsClient. + */ +public final class ScopeAccessReviewInstanceDecisionsClientImpl implements ScopeAccessReviewInstanceDecisionsClient { + /** The proxy service used to perform REST calls. */ + private final ScopeAccessReviewInstanceDecisionsService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of ScopeAccessReviewInstanceDecisionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ScopeAccessReviewInstanceDecisionsClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy + .create( + ScopeAccessReviewInstanceDecisionsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AuthorizationManagementClientScopeAccessReviewInstanceDecisions to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + private interface ScopeAccessReviewInstanceDecisionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/{scope}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}" + + "/instances/{id}/decisions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("scope") String scope, + @PathParam("scheduleDefinitionId") String scheduleDefinitionId, + @PathParam("id") String id, + @QueryParam("api-version") String apiVersion, + @QueryParam(value = "$filter", encoded = true) String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get access review instance decisions. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance decisions along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String scope, String scheduleDefinitionId, String id, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + scope, + scheduleDefinitionId, + id, + this.client.getApiVersion(), + filter, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get access review instance decisions. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance decisions along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String scope, String scheduleDefinitionId, String id, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + scope, + scheduleDefinitionId, + id, + this.client.getApiVersion(), + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get access review instance decisions. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance decisions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String scope, String scheduleDefinitionId, String id, String filter) { + return new PagedFlux<>( + () -> listSinglePageAsync(scope, scheduleDefinitionId, id, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get access review instance decisions. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance decisions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String scope, String scheduleDefinitionId, String id) { + final String filter = null; + return new PagedFlux<>( + () -> listSinglePageAsync(scope, scheduleDefinitionId, id, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get access review instance decisions. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance decisions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String scope, String scheduleDefinitionId, String id, String filter, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(scope, scheduleDefinitionId, id, filter, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get access review instance decisions. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance decisions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String scope, String scheduleDefinitionId, String id) { + final String filter = null; + return new PagedIterable<>(listAsync(scope, scheduleDefinitionId, id, filter)); + } + + /** + * Get access review instance decisions. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance decisions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String scope, String scheduleDefinitionId, String id, String filter, Context context) { + return new PagedIterable<>(listAsync(scope, scheduleDefinitionId, id, filter, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of access review decisions along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of access review decisions along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewInstanceDecisionsImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewInstanceDecisionsImpl.java new file mode 100644 index 0000000000000..4a9af27f11d75 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewInstanceDecisionsImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.authorization.generated.fluent.ScopeAccessReviewInstanceDecisionsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewDecisionInner; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewDecision; +import com.azure.resourcemanager.authorization.generated.models.ScopeAccessReviewInstanceDecisions; + +public final class ScopeAccessReviewInstanceDecisionsImpl implements ScopeAccessReviewInstanceDecisions { + private static final ClientLogger LOGGER = new ClientLogger(ScopeAccessReviewInstanceDecisionsImpl.class); + + private final ScopeAccessReviewInstanceDecisionsClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public ScopeAccessReviewInstanceDecisionsImpl( + ScopeAccessReviewInstanceDecisionsClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String scope, String scheduleDefinitionId, String id) { + PagedIterable inner = this.serviceClient().list(scope, scheduleDefinitionId, id); + return Utils.mapPage(inner, inner1 -> new AccessReviewDecisionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String scope, String scheduleDefinitionId, String id, String filter, Context context) { + PagedIterable inner = + this.serviceClient().list(scope, scheduleDefinitionId, id, filter, context); + return Utils.mapPage(inner, inner1 -> new AccessReviewDecisionImpl(inner1, this.manager())); + } + + private ScopeAccessReviewInstanceDecisionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewInstanceOperationsClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewInstanceOperationsClientImpl.java new file mode 100644 index 0000000000000..f13cce5d200ed --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewInstanceOperationsClientImpl.java @@ -0,0 +1,855 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.authorization.generated.fluent.ScopeAccessReviewInstanceOperationsClient; +import com.azure.resourcemanager.authorization.generated.models.RecordAllDecisionsProperties; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ScopeAccessReviewInstanceOperationsClient. + */ +public final class ScopeAccessReviewInstanceOperationsClientImpl implements ScopeAccessReviewInstanceOperationsClient { + /** The proxy service used to perform REST calls. */ + private final ScopeAccessReviewInstanceOperationsService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of ScopeAccessReviewInstanceOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ScopeAccessReviewInstanceOperationsClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy + .create( + ScopeAccessReviewInstanceOperationsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AuthorizationManagementClientScopeAccessReviewInstanceOperations to + * be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + private interface ScopeAccessReviewInstanceOperationsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/{scope}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}" + + "/instances/{id}/stop") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> stop( + @HostParam("$host") String endpoint, + @PathParam("scope") String scope, + @PathParam("scheduleDefinitionId") String scheduleDefinitionId, + @PathParam("id") String id, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/{scope}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}" + + "/instances/{id}/recordAllDecisions") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> recordAllDecisions( + @HostParam("$host") String endpoint, + @PathParam("scope") String scope, + @PathParam("scheduleDefinitionId") String scheduleDefinitionId, + @PathParam("id") String id, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RecordAllDecisionsProperties properties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/{scope}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}" + + "/instances/{id}/resetDecisions") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> resetDecisions( + @HostParam("$host") String endpoint, + @PathParam("scope") String scope, + @PathParam("scheduleDefinitionId") String scheduleDefinitionId, + @PathParam("id") String id, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/{scope}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}" + + "/instances/{id}/applyDecisions") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> applyDecisions( + @HostParam("$host") String endpoint, + @PathParam("scope") String scope, + @PathParam("scheduleDefinitionId") String scheduleDefinitionId, + @PathParam("id") String id, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/{scope}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}" + + "/instances/{id}/sendReminders") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> sendReminders( + @HostParam("$host") String endpoint, + @PathParam("scope") String scope, + @PathParam("scheduleDefinitionId") String scheduleDefinitionId, + @PathParam("id") String id, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * An action to stop an access review instance. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> stopWithResponseAsync(String scope, String scheduleDefinitionId, String id) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .stop( + this.client.getEndpoint(), + scope, + scheduleDefinitionId, + id, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * An action to stop an access review instance. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> stopWithResponseAsync( + String scope, String scheduleDefinitionId, String id, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stop( + this.client.getEndpoint(), + scope, + scheduleDefinitionId, + id, + this.client.getApiVersion(), + accept, + context); + } + + /** + * An action to stop an access review instance. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync(String scope, String scheduleDefinitionId, String id) { + return stopWithResponseAsync(scope, scheduleDefinitionId, id).flatMap(ignored -> Mono.empty()); + } + + /** + * An action to stop an access review instance. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stop(String scope, String scheduleDefinitionId, String id) { + stopAsync(scope, scheduleDefinitionId, id).block(); + } + + /** + * An action to stop an access review instance. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response stopWithResponse(String scope, String scheduleDefinitionId, String id, Context context) { + return stopWithResponseAsync(scope, scheduleDefinitionId, id, context).block(); + } + + /** + * An action to approve/deny all decisions for a review with certain filters. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param properties Record all decisions payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> recordAllDecisionsWithResponseAsync( + String scope, String scheduleDefinitionId, String id, RecordAllDecisionsProperties properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .recordAllDecisions( + this.client.getEndpoint(), + scope, + scheduleDefinitionId, + id, + this.client.getApiVersion(), + properties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * An action to approve/deny all decisions for a review with certain filters. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param properties Record all decisions payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> recordAllDecisionsWithResponseAsync( + String scope, + String scheduleDefinitionId, + String id, + RecordAllDecisionsProperties properties, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .recordAllDecisions( + this.client.getEndpoint(), + scope, + scheduleDefinitionId, + id, + this.client.getApiVersion(), + properties, + accept, + context); + } + + /** + * An action to approve/deny all decisions for a review with certain filters. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param properties Record all decisions payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono recordAllDecisionsAsync( + String scope, String scheduleDefinitionId, String id, RecordAllDecisionsProperties properties) { + return recordAllDecisionsWithResponseAsync(scope, scheduleDefinitionId, id, properties) + .flatMap(ignored -> Mono.empty()); + } + + /** + * An action to approve/deny all decisions for a review with certain filters. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param properties Record all decisions payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void recordAllDecisions( + String scope, String scheduleDefinitionId, String id, RecordAllDecisionsProperties properties) { + recordAllDecisionsAsync(scope, scheduleDefinitionId, id, properties).block(); + } + + /** + * An action to approve/deny all decisions for a review with certain filters. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param properties Record all decisions payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response recordAllDecisionsWithResponse( + String scope, + String scheduleDefinitionId, + String id, + RecordAllDecisionsProperties properties, + Context context) { + return recordAllDecisionsWithResponseAsync(scope, scheduleDefinitionId, id, properties, context).block(); + } + + /** + * An action to reset all decisions for an access review instance. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> resetDecisionsWithResponseAsync(String scope, String scheduleDefinitionId, String id) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .resetDecisions( + this.client.getEndpoint(), + scope, + scheduleDefinitionId, + id, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * An action to reset all decisions for an access review instance. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> resetDecisionsWithResponseAsync( + String scope, String scheduleDefinitionId, String id, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .resetDecisions( + this.client.getEndpoint(), + scope, + scheduleDefinitionId, + id, + this.client.getApiVersion(), + accept, + context); + } + + /** + * An action to reset all decisions for an access review instance. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resetDecisionsAsync(String scope, String scheduleDefinitionId, String id) { + return resetDecisionsWithResponseAsync(scope, scheduleDefinitionId, id).flatMap(ignored -> Mono.empty()); + } + + /** + * An action to reset all decisions for an access review instance. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void resetDecisions(String scope, String scheduleDefinitionId, String id) { + resetDecisionsAsync(scope, scheduleDefinitionId, id).block(); + } + + /** + * An action to reset all decisions for an access review instance. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response resetDecisionsWithResponse( + String scope, String scheduleDefinitionId, String id, Context context) { + return resetDecisionsWithResponseAsync(scope, scheduleDefinitionId, id, context).block(); + } + + /** + * An action to apply all decisions for an access review instance. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> applyDecisionsWithResponseAsync(String scope, String scheduleDefinitionId, String id) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .applyDecisions( + this.client.getEndpoint(), + scope, + scheduleDefinitionId, + id, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * An action to apply all decisions for an access review instance. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> applyDecisionsWithResponseAsync( + String scope, String scheduleDefinitionId, String id, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .applyDecisions( + this.client.getEndpoint(), + scope, + scheduleDefinitionId, + id, + this.client.getApiVersion(), + accept, + context); + } + + /** + * An action to apply all decisions for an access review instance. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono applyDecisionsAsync(String scope, String scheduleDefinitionId, String id) { + return applyDecisionsWithResponseAsync(scope, scheduleDefinitionId, id).flatMap(ignored -> Mono.empty()); + } + + /** + * An action to apply all decisions for an access review instance. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void applyDecisions(String scope, String scheduleDefinitionId, String id) { + applyDecisionsAsync(scope, scheduleDefinitionId, id).block(); + } + + /** + * An action to apply all decisions for an access review instance. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response applyDecisionsWithResponse( + String scope, String scheduleDefinitionId, String id, Context context) { + return applyDecisionsWithResponseAsync(scope, scheduleDefinitionId, id, context).block(); + } + + /** + * An action to send reminders for an access review instance. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> sendRemindersWithResponseAsync(String scope, String scheduleDefinitionId, String id) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .sendReminders( + this.client.getEndpoint(), + scope, + scheduleDefinitionId, + id, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * An action to send reminders for an access review instance. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> sendRemindersWithResponseAsync( + String scope, String scheduleDefinitionId, String id, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .sendReminders( + this.client.getEndpoint(), + scope, + scheduleDefinitionId, + id, + this.client.getApiVersion(), + accept, + context); + } + + /** + * An action to send reminders for an access review instance. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono sendRemindersAsync(String scope, String scheduleDefinitionId, String id) { + return sendRemindersWithResponseAsync(scope, scheduleDefinitionId, id).flatMap(ignored -> Mono.empty()); + } + + /** + * An action to send reminders for an access review instance. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void sendReminders(String scope, String scheduleDefinitionId, String id) { + sendRemindersAsync(scope, scheduleDefinitionId, id).block(); + } + + /** + * An action to send reminders for an access review instance. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response sendRemindersWithResponse( + String scope, String scheduleDefinitionId, String id, Context context) { + return sendRemindersWithResponseAsync(scope, scheduleDefinitionId, id, context).block(); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewInstanceOperationsImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewInstanceOperationsImpl.java new file mode 100644 index 0000000000000..0b7a2b535c496 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewInstanceOperationsImpl.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.authorization.generated.fluent.ScopeAccessReviewInstanceOperationsClient; +import com.azure.resourcemanager.authorization.generated.models.RecordAllDecisionsProperties; +import com.azure.resourcemanager.authorization.generated.models.ScopeAccessReviewInstanceOperations; + +public final class ScopeAccessReviewInstanceOperationsImpl implements ScopeAccessReviewInstanceOperations { + private static final ClientLogger LOGGER = new ClientLogger(ScopeAccessReviewInstanceOperationsImpl.class); + + private final ScopeAccessReviewInstanceOperationsClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public ScopeAccessReviewInstanceOperationsImpl( + ScopeAccessReviewInstanceOperationsClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void stop(String scope, String scheduleDefinitionId, String id) { + this.serviceClient().stop(scope, scheduleDefinitionId, id); + } + + public Response stopWithResponse(String scope, String scheduleDefinitionId, String id, Context context) { + return this.serviceClient().stopWithResponse(scope, scheduleDefinitionId, id, context); + } + + public void recordAllDecisions( + String scope, String scheduleDefinitionId, String id, RecordAllDecisionsProperties properties) { + this.serviceClient().recordAllDecisions(scope, scheduleDefinitionId, id, properties); + } + + public Response recordAllDecisionsWithResponse( + String scope, + String scheduleDefinitionId, + String id, + RecordAllDecisionsProperties properties, + Context context) { + return this + .serviceClient() + .recordAllDecisionsWithResponse(scope, scheduleDefinitionId, id, properties, context); + } + + public void resetDecisions(String scope, String scheduleDefinitionId, String id) { + this.serviceClient().resetDecisions(scope, scheduleDefinitionId, id); + } + + public Response resetDecisionsWithResponse( + String scope, String scheduleDefinitionId, String id, Context context) { + return this.serviceClient().resetDecisionsWithResponse(scope, scheduleDefinitionId, id, context); + } + + public void applyDecisions(String scope, String scheduleDefinitionId, String id) { + this.serviceClient().applyDecisions(scope, scheduleDefinitionId, id); + } + + public Response applyDecisionsWithResponse( + String scope, String scheduleDefinitionId, String id, Context context) { + return this.serviceClient().applyDecisionsWithResponse(scope, scheduleDefinitionId, id, context); + } + + public void sendReminders(String scope, String scheduleDefinitionId, String id) { + this.serviceClient().sendReminders(scope, scheduleDefinitionId, id); + } + + public Response sendRemindersWithResponse( + String scope, String scheduleDefinitionId, String id, Context context) { + return this.serviceClient().sendRemindersWithResponse(scope, scheduleDefinitionId, id, context); + } + + private ScopeAccessReviewInstanceOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewInstancesClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewInstancesClientImpl.java new file mode 100644 index 0000000000000..8a5f247b25d27 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewInstancesClientImpl.java @@ -0,0 +1,706 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.authorization.generated.fluent.ScopeAccessReviewInstancesClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewInstanceInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewInstanceProperties; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewInstanceListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ScopeAccessReviewInstancesClient. */ +public final class ScopeAccessReviewInstancesClientImpl implements ScopeAccessReviewInstancesClient { + /** The proxy service used to perform REST calls. */ + private final ScopeAccessReviewInstancesService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of ScopeAccessReviewInstancesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ScopeAccessReviewInstancesClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy + .create( + ScopeAccessReviewInstancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AuthorizationManagementClientScopeAccessReviewInstances to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + private interface ScopeAccessReviewInstancesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/{scope}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}" + + "/instances") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("scope") String scope, + @PathParam("scheduleDefinitionId") String scheduleDefinitionId, + @QueryParam("api-version") String apiVersion, + @QueryParam(value = "$filter", encoded = true) String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/{scope}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}" + + "/instances/{id}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getById( + @HostParam("$host") String endpoint, + @PathParam("scope") String scope, + @PathParam("scheduleDefinitionId") String scheduleDefinitionId, + @PathParam("id") String id, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/{scope}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}" + + "/instances/{id}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam("scope") String scope, + @PathParam("scheduleDefinitionId") String scheduleDefinitionId, + @PathParam("id") String id, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AccessReviewInstanceProperties properties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get access review instances. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String scope, String scheduleDefinitionId, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + scope, + scheduleDefinitionId, + this.client.getApiVersion(), + filter, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get access review instances. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String scope, String scheduleDefinitionId, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + scope, + scheduleDefinitionId, + this.client.getApiVersion(), + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get access review instances. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String scope, String scheduleDefinitionId, String filter) { + return new PagedFlux<>( + () -> listSinglePageAsync(scope, scheduleDefinitionId, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get access review instances. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String scope, String scheduleDefinitionId) { + final String filter = null; + return new PagedFlux<>( + () -> listSinglePageAsync(scope, scheduleDefinitionId, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get access review instances. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String scope, String scheduleDefinitionId, String filter, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(scope, scheduleDefinitionId, filter, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get access review instances. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String scope, String scheduleDefinitionId) { + final String filter = null; + return new PagedIterable<>(listAsync(scope, scheduleDefinitionId, filter)); + } + + /** + * Get access review instances. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String scope, String scheduleDefinitionId, String filter, Context context) { + return new PagedIterable<>(listAsync(scope, scheduleDefinitionId, filter, context)); + } + + /** + * Get access review instances. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByIdWithResponseAsync( + String scope, String scheduleDefinitionId, String id) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getById( + this.client.getEndpoint(), + scope, + scheduleDefinitionId, + id, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get access review instances. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByIdWithResponseAsync( + String scope, String scheduleDefinitionId, String id, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getById( + this.client.getEndpoint(), + scope, + scheduleDefinitionId, + id, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get access review instances. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByIdAsync(String scope, String scheduleDefinitionId, String id) { + return getByIdWithResponseAsync(scope, scheduleDefinitionId, id) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get access review instances. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessReviewInstanceInner getById(String scope, String scheduleDefinitionId, String id) { + return getByIdAsync(scope, scheduleDefinitionId, id).block(); + } + + /** + * Get access review instances. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByIdWithResponse( + String scope, String scheduleDefinitionId, String id, Context context) { + return getByIdWithResponseAsync(scope, scheduleDefinitionId, id, context).block(); + } + + /** + * Update access review instance. + * + * @param scope The scope of the resource. + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review Instance along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String scope, String scheduleDefinitionId, String id, AccessReviewInstanceProperties properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + scope, + scheduleDefinitionId, + id, + this.client.getApiVersion(), + properties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update access review instance. + * + * @param scope The scope of the resource. + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review Instance along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String scope, + String scheduleDefinitionId, + String id, + AccessReviewInstanceProperties properties, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + scope, + scheduleDefinitionId, + id, + this.client.getApiVersion(), + properties, + accept, + context); + } + + /** + * Update access review instance. + * + * @param scope The scope of the resource. + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review Instance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String scope, String scheduleDefinitionId, String id, AccessReviewInstanceProperties properties) { + return createWithResponseAsync(scope, scheduleDefinitionId, id, properties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Update access review instance. + * + * @param scope The scope of the resource. + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessReviewInstanceInner create( + String scope, String scheduleDefinitionId, String id, AccessReviewInstanceProperties properties) { + return createAsync(scope, scheduleDefinitionId, id, properties).block(); + } + + /** + * Update access review instance. + * + * @param scope The scope of the resource. + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review Instance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String scope, + String scheduleDefinitionId, + String id, + AccessReviewInstanceProperties properties, + Context context) { + return createWithResponseAsync(scope, scheduleDefinitionId, id, properties, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review Instances along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review Instances along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewInstancesImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewInstancesImpl.java new file mode 100644 index 0000000000000..af3edb1a21c71 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewInstancesImpl.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.authorization.generated.fluent.ScopeAccessReviewInstancesClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewInstanceInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewInstanceProperties; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewInstance; +import com.azure.resourcemanager.authorization.generated.models.ScopeAccessReviewInstances; + +public final class ScopeAccessReviewInstancesImpl implements ScopeAccessReviewInstances { + private static final ClientLogger LOGGER = new ClientLogger(ScopeAccessReviewInstancesImpl.class); + + private final ScopeAccessReviewInstancesClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public ScopeAccessReviewInstancesImpl( + ScopeAccessReviewInstancesClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String scope, String scheduleDefinitionId) { + PagedIterable inner = this.serviceClient().list(scope, scheduleDefinitionId); + return Utils.mapPage(inner, inner1 -> new AccessReviewInstanceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String scope, String scheduleDefinitionId, String filter, Context context) { + PagedIterable inner = + this.serviceClient().list(scope, scheduleDefinitionId, filter, context); + return Utils.mapPage(inner, inner1 -> new AccessReviewInstanceImpl(inner1, this.manager())); + } + + public AccessReviewInstance getById(String scope, String scheduleDefinitionId, String id) { + AccessReviewInstanceInner inner = this.serviceClient().getById(scope, scheduleDefinitionId, id); + if (inner != null) { + return new AccessReviewInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByIdWithResponse( + String scope, String scheduleDefinitionId, String id, Context context) { + Response inner = + this.serviceClient().getByIdWithResponse(scope, scheduleDefinitionId, id, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AccessReviewInstanceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AccessReviewInstance create( + String scope, String scheduleDefinitionId, String id, AccessReviewInstanceProperties properties) { + AccessReviewInstanceInner inner = this.serviceClient().create(scope, scheduleDefinitionId, id, properties); + if (inner != null) { + return new AccessReviewInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createWithResponse( + String scope, + String scheduleDefinitionId, + String id, + AccessReviewInstanceProperties properties, + Context context) { + Response inner = + this.serviceClient().createWithResponse(scope, scheduleDefinitionId, id, properties, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AccessReviewInstanceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ScopeAccessReviewInstancesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewScheduleDefinitionsClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewScheduleDefinitionsClientImpl.java new file mode 100644 index 0000000000000..5f5084d846a20 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewScheduleDefinitionsClientImpl.java @@ -0,0 +1,897 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.authorization.generated.fluent.ScopeAccessReviewScheduleDefinitionsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewScheduleDefinitionInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewScheduleDefinitionProperties; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewScheduleDefinitionListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * ScopeAccessReviewScheduleDefinitionsClient. + */ +public final class ScopeAccessReviewScheduleDefinitionsClientImpl + implements ScopeAccessReviewScheduleDefinitionsClient { + /** The proxy service used to perform REST calls. */ + private final ScopeAccessReviewScheduleDefinitionsService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of ScopeAccessReviewScheduleDefinitionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ScopeAccessReviewScheduleDefinitionsClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy + .create( + ScopeAccessReviewScheduleDefinitionsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AuthorizationManagementClientScopeAccessReviewScheduleDefinitions to + * be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + private interface ScopeAccessReviewScheduleDefinitionsService { + @Headers({"Content-Type: application/json"}) + @Get("/{scope}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("scope") String scope, + @QueryParam("api-version") String apiVersion, + @QueryParam(value = "$filter", encoded = true) String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/{scope}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getById( + @HostParam("$host") String endpoint, + @PathParam("scope") String scope, + @PathParam("scheduleDefinitionId") String scheduleDefinitionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete("/{scope}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> deleteById( + @HostParam("$host") String endpoint, + @PathParam("scope") String scope, + @PathParam("scheduleDefinitionId") String scheduleDefinitionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put("/{scope}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdateById( + @HostParam("$host") String endpoint, + @PathParam("scope") String scope, + @PathParam("scheduleDefinitionId") String scheduleDefinitionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AccessReviewScheduleDefinitionProperties properties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/{scope}/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/stop") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> stop( + @HostParam("$host") String endpoint, + @PathParam("scope") String scope, + @PathParam("scheduleDefinitionId") String scheduleDefinitionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get access review schedule definitions. + * + * @param scope The scope of the resource. + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review schedule definitions along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String scope, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), scope, this.client.getApiVersion(), filter, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get access review schedule definitions. + * + * @param scope The scope of the resource. + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review schedule definitions along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String scope, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), scope, this.client.getApiVersion(), filter, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get access review schedule definitions. + * + * @param scope The scope of the resource. + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review schedule definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String scope, String filter) { + return new PagedFlux<>(() -> listSinglePageAsync(scope, filter), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get access review schedule definitions. + * + * @param scope The scope of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review schedule definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String scope) { + final String filter = null; + return new PagedFlux<>(() -> listSinglePageAsync(scope, filter), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get access review schedule definitions. + * + * @param scope The scope of the resource. + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review schedule definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String scope, String filter, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(scope, filter, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get access review schedule definitions. + * + * @param scope The scope of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review schedule definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String scope) { + final String filter = null; + return new PagedIterable<>(listAsync(scope, filter)); + } + + /** + * Get access review schedule definitions. + * + * @param scope The scope of the resource. + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review schedule definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String scope, String filter, Context context) { + return new PagedIterable<>(listAsync(scope, filter, context)); + } + + /** + * Get single access review definition. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single access review definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByIdWithResponseAsync( + String scope, String scheduleDefinitionId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getById( + this.client.getEndpoint(), + scope, + scheduleDefinitionId, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get single access review definition. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single access review definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByIdWithResponseAsync( + String scope, String scheduleDefinitionId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getById( + this.client.getEndpoint(), scope, scheduleDefinitionId, this.client.getApiVersion(), accept, context); + } + + /** + * Get single access review definition. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single access review definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByIdAsync(String scope, String scheduleDefinitionId) { + return getByIdWithResponseAsync(scope, scheduleDefinitionId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get single access review definition. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single access review definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessReviewScheduleDefinitionInner getById(String scope, String scheduleDefinitionId) { + return getByIdAsync(scope, scheduleDefinitionId).block(); + } + + /** + * Get single access review definition. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single access review definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByIdWithResponse( + String scope, String scheduleDefinitionId, Context context) { + return getByIdWithResponseAsync(scope, scheduleDefinitionId, context).block(); + } + + /** + * Delete access review schedule definition. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteByIdWithResponseAsync(String scope, String scheduleDefinitionId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteById( + this.client.getEndpoint(), + scope, + scheduleDefinitionId, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete access review schedule definition. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteByIdWithResponseAsync( + String scope, String scheduleDefinitionId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteById( + this.client.getEndpoint(), scope, scheduleDefinitionId, this.client.getApiVersion(), accept, context); + } + + /** + * Delete access review schedule definition. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteByIdAsync(String scope, String scheduleDefinitionId) { + return deleteByIdWithResponseAsync(scope, scheduleDefinitionId).flatMap(ignored -> Mono.empty()); + } + + /** + * Delete access review schedule definition. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteById(String scope, String scheduleDefinitionId) { + deleteByIdAsync(scope, scheduleDefinitionId).block(); + } + + /** + * Delete access review schedule definition. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteByIdWithResponse(String scope, String scheduleDefinitionId, Context context) { + return deleteByIdWithResponseAsync(scope, scheduleDefinitionId, context).block(); + } + + /** + * Create or Update access review schedule definition. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param properties Access review schedule definition properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review Schedule Definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateByIdWithResponseAsync( + String scope, String scheduleDefinitionId, AccessReviewScheduleDefinitionProperties properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdateById( + this.client.getEndpoint(), + scope, + scheduleDefinitionId, + this.client.getApiVersion(), + properties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or Update access review schedule definition. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param properties Access review schedule definition properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review Schedule Definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateByIdWithResponseAsync( + String scope, + String scheduleDefinitionId, + AccessReviewScheduleDefinitionProperties properties, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdateById( + this.client.getEndpoint(), + scope, + scheduleDefinitionId, + this.client.getApiVersion(), + properties, + accept, + context); + } + + /** + * Create or Update access review schedule definition. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param properties Access review schedule definition properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review Schedule Definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateByIdAsync( + String scope, String scheduleDefinitionId, AccessReviewScheduleDefinitionProperties properties) { + return createOrUpdateByIdWithResponseAsync(scope, scheduleDefinitionId, properties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create or Update access review schedule definition. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param properties Access review schedule definition properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review Schedule Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessReviewScheduleDefinitionInner createOrUpdateById( + String scope, String scheduleDefinitionId, AccessReviewScheduleDefinitionProperties properties) { + return createOrUpdateByIdAsync(scope, scheduleDefinitionId, properties).block(); + } + + /** + * Create or Update access review schedule definition. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param properties Access review schedule definition properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review Schedule Definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateByIdWithResponse( + String scope, + String scheduleDefinitionId, + AccessReviewScheduleDefinitionProperties properties, + Context context) { + return createOrUpdateByIdWithResponseAsync(scope, scheduleDefinitionId, properties, context).block(); + } + + /** + * Stop access review definition. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> stopWithResponseAsync(String scope, String scheduleDefinitionId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .stop( + this.client.getEndpoint(), + scope, + scheduleDefinitionId, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Stop access review definition. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> stopWithResponseAsync(String scope, String scheduleDefinitionId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stop(this.client.getEndpoint(), scope, scheduleDefinitionId, this.client.getApiVersion(), accept, context); + } + + /** + * Stop access review definition. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync(String scope, String scheduleDefinitionId) { + return stopWithResponseAsync(scope, scheduleDefinitionId).flatMap(ignored -> Mono.empty()); + } + + /** + * Stop access review definition. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stop(String scope, String scheduleDefinitionId) { + stopAsync(scope, scheduleDefinitionId).block(); + } + + /** + * Stop access review definition. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response stopWithResponse(String scope, String scheduleDefinitionId, Context context) { + return stopWithResponseAsync(scope, scheduleDefinitionId, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review Schedule Definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review Schedule Definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewScheduleDefinitionsImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewScheduleDefinitionsImpl.java new file mode 100644 index 0000000000000..8ccb5b1cc5fbd --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewScheduleDefinitionsImpl.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.authorization.generated.fluent.ScopeAccessReviewScheduleDefinitionsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewScheduleDefinitionInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewScheduleDefinitionProperties; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewScheduleDefinition; +import com.azure.resourcemanager.authorization.generated.models.ScopeAccessReviewScheduleDefinitions; + +public final class ScopeAccessReviewScheduleDefinitionsImpl implements ScopeAccessReviewScheduleDefinitions { + private static final ClientLogger LOGGER = new ClientLogger(ScopeAccessReviewScheduleDefinitionsImpl.class); + + private final ScopeAccessReviewScheduleDefinitionsClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public ScopeAccessReviewScheduleDefinitionsImpl( + ScopeAccessReviewScheduleDefinitionsClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String scope) { + PagedIterable inner = this.serviceClient().list(scope); + return Utils.mapPage(inner, inner1 -> new AccessReviewScheduleDefinitionImpl(inner1, this.manager())); + } + + public PagedIterable list(String scope, String filter, Context context) { + PagedIterable inner = this.serviceClient().list(scope, filter, context); + return Utils.mapPage(inner, inner1 -> new AccessReviewScheduleDefinitionImpl(inner1, this.manager())); + } + + public AccessReviewScheduleDefinition getById(String scope, String scheduleDefinitionId) { + AccessReviewScheduleDefinitionInner inner = this.serviceClient().getById(scope, scheduleDefinitionId); + if (inner != null) { + return new AccessReviewScheduleDefinitionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByIdWithResponse( + String scope, String scheduleDefinitionId, Context context) { + Response inner = + this.serviceClient().getByIdWithResponse(scope, scheduleDefinitionId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AccessReviewScheduleDefinitionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteById(String scope, String scheduleDefinitionId) { + this.serviceClient().deleteById(scope, scheduleDefinitionId); + } + + public Response deleteByIdWithResponse(String scope, String scheduleDefinitionId, Context context) { + return this.serviceClient().deleteByIdWithResponse(scope, scheduleDefinitionId, context); + } + + public AccessReviewScheduleDefinition createOrUpdateById( + String scope, String scheduleDefinitionId, AccessReviewScheduleDefinitionProperties properties) { + AccessReviewScheduleDefinitionInner inner = + this.serviceClient().createOrUpdateById(scope, scheduleDefinitionId, properties); + if (inner != null) { + return new AccessReviewScheduleDefinitionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateByIdWithResponse( + String scope, + String scheduleDefinitionId, + AccessReviewScheduleDefinitionProperties properties, + Context context) { + Response inner = + this.serviceClient().createOrUpdateByIdWithResponse(scope, scheduleDefinitionId, properties, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AccessReviewScheduleDefinitionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void stop(String scope, String scheduleDefinitionId) { + this.serviceClient().stop(scope, scheduleDefinitionId); + } + + public Response stopWithResponse(String scope, String scheduleDefinitionId, Context context) { + return this.serviceClient().stopWithResponse(scope, scheduleDefinitionId, context); + } + + private ScopeAccessReviewScheduleDefinitionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/TenantLevelAccessReviewInstanceContactedReviewersClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/TenantLevelAccessReviewInstanceContactedReviewersClientImpl.java new file mode 100644 index 0000000000000..70edf5fe9e1a2 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/TenantLevelAccessReviewInstanceContactedReviewersClientImpl.java @@ -0,0 +1,329 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.authorization.generated.fluent.TenantLevelAccessReviewInstanceContactedReviewersClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewContactedReviewerInner; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewContactedReviewerListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * TenantLevelAccessReviewInstanceContactedReviewersClient. + */ +public final class TenantLevelAccessReviewInstanceContactedReviewersClientImpl + implements TenantLevelAccessReviewInstanceContactedReviewersClient { + /** The proxy service used to perform REST calls. */ + private final TenantLevelAccessReviewInstanceContactedReviewersService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of TenantLevelAccessReviewInstanceContactedReviewersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TenantLevelAccessReviewInstanceContactedReviewersClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy + .create( + TenantLevelAccessReviewInstanceContactedReviewersService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * AuthorizationManagementClientTenantLevelAccessReviewInstanceContactedReviewers to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + private interface TenantLevelAccessReviewInstanceContactedReviewersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/providers/Microsoft.Authorization/accessReviewScheduleDefinitions/{scheduleDefinitionId}/instances/{id}" + + "/contactedReviewers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("scheduleDefinitionId") String scheduleDefinitionId, + @PathParam("id") String id, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance contacted reviewers along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String scheduleDefinitionId, String id) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + scheduleDefinitionId, + id, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance contacted reviewers along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String scheduleDefinitionId, String id, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scheduleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scheduleDefinitionId is required and cannot be null.")); + } + if (id == null) { + return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), scheduleDefinitionId, id, this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance contacted reviewers as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String scheduleDefinitionId, String id) { + return new PagedFlux<>( + () -> listSinglePageAsync(scheduleDefinitionId, id), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance contacted reviewers as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String scheduleDefinitionId, String id, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(scheduleDefinitionId, id, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance contacted reviewers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String scheduleDefinitionId, String id) { + return new PagedIterable<>(listAsync(scheduleDefinitionId, id)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance contacted reviewers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String scheduleDefinitionId, String id, Context context) { + return new PagedIterable<>(listAsync(scheduleDefinitionId, id, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of access review contacted reviewers along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of access review contacted reviewers along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/TenantLevelAccessReviewInstanceContactedReviewersImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/TenantLevelAccessReviewInstanceContactedReviewersImpl.java new file mode 100644 index 0000000000000..7d2b85d1ab33b --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/TenantLevelAccessReviewInstanceContactedReviewersImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.authorization.generated.fluent.TenantLevelAccessReviewInstanceContactedReviewersClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewContactedReviewerInner; +import com.azure.resourcemanager.authorization.generated.models.AccessReviewContactedReviewer; +import com.azure.resourcemanager.authorization.generated.models.TenantLevelAccessReviewInstanceContactedReviewers; + +public final class TenantLevelAccessReviewInstanceContactedReviewersImpl + implements TenantLevelAccessReviewInstanceContactedReviewers { + private static final ClientLogger LOGGER = + new ClientLogger(TenantLevelAccessReviewInstanceContactedReviewersImpl.class); + + private final TenantLevelAccessReviewInstanceContactedReviewersClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public TenantLevelAccessReviewInstanceContactedReviewersImpl( + TenantLevelAccessReviewInstanceContactedReviewersClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String scheduleDefinitionId, String id) { + PagedIterable inner = this.serviceClient().list(scheduleDefinitionId, id); + return Utils.mapPage(inner, inner1 -> new AccessReviewContactedReviewerImpl(inner1, this.manager())); + } + + public PagedIterable list(String scheduleDefinitionId, String id, Context context) { + PagedIterable inner = + this.serviceClient().list(scheduleDefinitionId, id, context); + return Utils.mapPage(inner, inner1 -> new AccessReviewContactedReviewerImpl(inner1, this.manager())); + } + + private TenantLevelAccessReviewInstanceContactedReviewersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/Utils.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/Utils.java new file mode 100644 index 0000000000000..9ee144b3a9883 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/Utils.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/package-info.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/package-info.java new file mode 100644 index 0000000000000..37a53e1b81087 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the implementations for AuthorizationManagementClient. Access reviews service provides the + * workflow for running access reviews on different kind of resources. + */ +package com.azure.resourcemanager.authorization.generated.implementation; diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessRecommendationType.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessRecommendationType.java new file mode 100644 index 0000000000000..2ff26cdb69b35 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessRecommendationType.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The feature- generated recommendation shown to the reviewer. */ +public final class AccessRecommendationType extends ExpandableStringEnum { + /** Static value Approve for AccessRecommendationType. */ + public static final AccessRecommendationType APPROVE = fromString("Approve"); + + /** Static value Deny for AccessRecommendationType. */ + public static final AccessRecommendationType DENY = fromString("Deny"); + + /** Static value NoInfoAvailable for AccessRecommendationType. */ + public static final AccessRecommendationType NO_INFO_AVAILABLE = fromString("NoInfoAvailable"); + + /** + * Creates or finds a AccessRecommendationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccessRecommendationType. + */ + @JsonCreator + public static AccessRecommendationType fromString(String name) { + return fromString(name, AccessRecommendationType.class); + } + + /** + * Gets known AccessRecommendationType values. + * + * @return known AccessRecommendationType values. + */ + public static Collection values() { + return values(AccessRecommendationType.class); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewActorIdentityType.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewActorIdentityType.java new file mode 100644 index 0000000000000..1657cbaa23c58 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewActorIdentityType.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The identity type : user/servicePrincipal. */ +public final class AccessReviewActorIdentityType extends ExpandableStringEnum { + /** Static value user for AccessReviewActorIdentityType. */ + public static final AccessReviewActorIdentityType USER = fromString("user"); + + /** Static value servicePrincipal for AccessReviewActorIdentityType. */ + public static final AccessReviewActorIdentityType SERVICE_PRINCIPAL = fromString("servicePrincipal"); + + /** + * Creates or finds a AccessReviewActorIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccessReviewActorIdentityType. + */ + @JsonCreator + public static AccessReviewActorIdentityType fromString(String name) { + return fromString(name, AccessReviewActorIdentityType.class); + } + + /** + * Gets known AccessReviewActorIdentityType values. + * + * @return known AccessReviewActorIdentityType values. + */ + public static Collection values() { + return values(AccessReviewActorIdentityType.class); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewApplyResult.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewApplyResult.java new file mode 100644 index 0000000000000..3cc48f968d508 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewApplyResult.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The outcome of applying the decision. */ +public final class AccessReviewApplyResult extends ExpandableStringEnum { + /** Static value New for AccessReviewApplyResult. */ + public static final AccessReviewApplyResult NEW = fromString("New"); + + /** Static value Applying for AccessReviewApplyResult. */ + public static final AccessReviewApplyResult APPLYING = fromString("Applying"); + + /** Static value AppliedSuccessfully for AccessReviewApplyResult. */ + public static final AccessReviewApplyResult APPLIED_SUCCESSFULLY = fromString("AppliedSuccessfully"); + + /** Static value AppliedWithUnknownFailure for AccessReviewApplyResult. */ + public static final AccessReviewApplyResult APPLIED_WITH_UNKNOWN_FAILURE = fromString("AppliedWithUnknownFailure"); + + /** Static value AppliedSuccessfullyButObjectNotFound for AccessReviewApplyResult. */ + public static final AccessReviewApplyResult APPLIED_SUCCESSFULLY_BUT_OBJECT_NOT_FOUND = + fromString("AppliedSuccessfullyButObjectNotFound"); + + /** Static value ApplyNotSupported for AccessReviewApplyResult. */ + public static final AccessReviewApplyResult APPLY_NOT_SUPPORTED = fromString("ApplyNotSupported"); + + /** + * Creates or finds a AccessReviewApplyResult from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccessReviewApplyResult. + */ + @JsonCreator + public static AccessReviewApplyResult fromString(String name) { + return fromString(name, AccessReviewApplyResult.class); + } + + /** + * Gets known AccessReviewApplyResult values. + * + * @return known AccessReviewApplyResult values. + */ + public static Collection values() { + return values(AccessReviewApplyResult.class); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewContactedReviewer.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewContactedReviewer.java new file mode 100644 index 0000000000000..2409391d12643 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewContactedReviewer.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewContactedReviewerInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of AccessReviewContactedReviewer. */ +public interface AccessReviewContactedReviewer { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the userDisplayName property: The display name of the reviewer. + * + * @return the userDisplayName value. + */ + String userDisplayName(); + + /** + * Gets the userPrincipalName property: The user principal name of the reviewer. + * + * @return the userPrincipalName value. + */ + String userPrincipalName(); + + /** + * Gets the createdDateTime property: Date Time when the reviewer was contacted. + * + * @return the createdDateTime value. + */ + OffsetDateTime createdDateTime(); + + /** + * Gets the inner com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewContactedReviewerInner + * object. + * + * @return the inner object. + */ + AccessReviewContactedReviewerInner innerModel(); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewContactedReviewerListResult.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewContactedReviewerListResult.java new file mode 100644 index 0000000000000..7710f454212f2 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewContactedReviewerListResult.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewContactedReviewerInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of access review contacted reviewers. */ +@Fluent +public final class AccessReviewContactedReviewerListResult { + /* + * Access Review Contacted Reviewer. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Access Review Contacted Reviewer. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Access Review Contacted Reviewer. + * + * @param value the value value to set. + * @return the AccessReviewContactedReviewerListResult object itself. + */ + public AccessReviewContactedReviewerListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to use for getting the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to use for getting the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the AccessReviewContactedReviewerListResult object itself. + */ + public AccessReviewContactedReviewerListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecision.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecision.java new file mode 100644 index 0000000000000..a5db44e250cc2 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecision.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewDecisionInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of AccessReviewDecision. */ +public interface AccessReviewDecision { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the recommendation property: The feature- generated recommendation shown to the reviewer. + * + * @return the recommendation value. + */ + AccessRecommendationType recommendation(); + + /** + * Gets the decision property: The decision on the approval step. This value is initially set to NotReviewed. + * Approvers can take action of Approve/Deny. + * + * @return the decision value. + */ + AccessReviewResult decision(); + + /** + * Gets the justification property: Justification provided by approvers for their action. + * + * @return the justification value. + */ + String justification(); + + /** + * Gets the reviewedDateTime property: Date Time when a decision was taken. + * + * @return the reviewedDateTime value. + */ + OffsetDateTime reviewedDateTime(); + + /** + * Gets the applyResult property: The outcome of applying the decision. + * + * @return the applyResult value. + */ + AccessReviewApplyResult applyResult(); + + /** + * Gets the appliedDateTime property: The date and time when the review decision was applied. + * + * @return the appliedDateTime value. + */ + OffsetDateTime appliedDateTime(); + + /** + * Gets the insights property: This is the collection of insights for this decision item. + * + * @return the insights value. + */ + List insights(); + + /** + * Gets the idPropertiesId property: The id of principal whose access was reviewed. + * + * @return the idPropertiesId value. + */ + String idPropertiesId(); + + /** + * Gets the displayName property: The display name of the user whose access was reviewed. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the typePropertiesType property: The type of resource. + * + * @return the typePropertiesType value. + */ + DecisionResourceType typePropertiesType(); + + /** + * Gets the idResourceId property: The id of resource associated with a decision record. + * + * @return the idResourceId value. + */ + String idResourceId(); + + /** + * Gets the displayNameResourceDisplayName property: The display name of resource associated with a decision record. + * + * @return the displayNameResourceDisplayName value. + */ + String displayNameResourceDisplayName(); + + /** + * Gets the principalId property: The identity id. + * + * @return the principalId value. + */ + String principalId(); + + /** + * Gets the principalType property: The identity type : user/servicePrincipal. + * + * @return the principalType value. + */ + AccessReviewActorIdentityType principalType(); + + /** + * Gets the principalName property: The identity display name. + * + * @return the principalName value. + */ + String principalName(); + + /** + * Gets the userPrincipalName property: The user principal name(if valid). + * + * @return the userPrincipalName value. + */ + String userPrincipalName(); + + /** + * Gets the principalIdAppliedByPrincipalId property: The identity id. + * + * @return the principalIdAppliedByPrincipalId value. + */ + String principalIdAppliedByPrincipalId(); + + /** + * Gets the principalTypeAppliedByPrincipalType property: The identity type : user/servicePrincipal. + * + * @return the principalTypeAppliedByPrincipalType value. + */ + AccessReviewActorIdentityType principalTypeAppliedByPrincipalType(); + + /** + * Gets the principalNameAppliedByPrincipalName property: The identity display name. + * + * @return the principalNameAppliedByPrincipalName value. + */ + String principalNameAppliedByPrincipalName(); + + /** + * Gets the userPrincipalNameAppliedByUserPrincipalName property: The user principal name(if valid). + * + * @return the userPrincipalNameAppliedByUserPrincipalName value. + */ + String userPrincipalNameAppliedByUserPrincipalName(); + + /** + * Gets the membershipTypes property: Every decision item in an access review represents a principal's membership to + * a resource. This property represents details of the membership. Examples of this detail might be whether the + * principal has direct access or indirect access. + * + * @return the membershipTypes value. + */ + List membershipTypes(); + + /** + * Gets the inner com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewDecisionInner object. + * + * @return the inner object. + */ + AccessReviewDecisionInner innerModel(); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionInsight.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionInsight.java new file mode 100644 index 0000000000000..d9984c0d607c2 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionInsight.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewDecisionInsightProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Access Review Decision Insight. */ +@Fluent +public final class AccessReviewDecisionInsight extends ProxyResource { + /* + * Access Review Decision Insight properties. + */ + @JsonProperty(value = "properties") + private AccessReviewDecisionInsightProperties innerProperties; + + /** + * Get the innerProperties property: Access Review Decision Insight properties. + * + * @return the innerProperties value. + */ + private AccessReviewDecisionInsightProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the insightCreatedDateTime property: Date Time when the insight was created. + * + * @return the insightCreatedDateTime value. + */ + public Object insightCreatedDateTime() { + return this.innerProperties() == null ? null : this.innerProperties().insightCreatedDateTime(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionInsightType.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionInsightType.java new file mode 100644 index 0000000000000..cf6edffb7edc1 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionInsightType.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of insight. */ +public final class AccessReviewDecisionInsightType extends ExpandableStringEnum { + /** Static value userSignInInsight for AccessReviewDecisionInsightType. */ + public static final AccessReviewDecisionInsightType USER_SIGN_IN_INSIGHT = fromString("userSignInInsight"); + + /** + * Creates or finds a AccessReviewDecisionInsightType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccessReviewDecisionInsightType. + */ + @JsonCreator + public static AccessReviewDecisionInsightType fromString(String name) { + return fromString(name, AccessReviewDecisionInsightType.class); + } + + /** + * Gets known AccessReviewDecisionInsightType values. + * + * @return known AccessReviewDecisionInsightType values. + */ + public static Collection values() { + return values(AccessReviewDecisionInsightType.class); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionListResult.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionListResult.java new file mode 100644 index 0000000000000..9f5d157b99f2b --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionListResult.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewDecisionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of access review decisions. */ +@Fluent +public final class AccessReviewDecisionListResult { + /* + * Access Review Decision list. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Access Review Decision list. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Access Review Decision list. + * + * @param value the value value to set. + * @return the AccessReviewDecisionListResult object itself. + */ + public AccessReviewDecisionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to use for getting the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to use for getting the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the AccessReviewDecisionListResult object itself. + */ + public AccessReviewDecisionListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionPrincipalResourceMembershipType.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionPrincipalResourceMembershipType.java new file mode 100644 index 0000000000000..acfb787adda2e --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionPrincipalResourceMembershipType.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AccessReviewDecisionPrincipalResourceMembershipType. */ +public final class AccessReviewDecisionPrincipalResourceMembershipType + extends ExpandableStringEnum { + /** Static value direct for AccessReviewDecisionPrincipalResourceMembershipType. */ + public static final AccessReviewDecisionPrincipalResourceMembershipType DIRECT = fromString("direct"); + + /** Static value indirect for AccessReviewDecisionPrincipalResourceMembershipType. */ + public static final AccessReviewDecisionPrincipalResourceMembershipType INDIRECT = fromString("indirect"); + + /** + * Creates or finds a AccessReviewDecisionPrincipalResourceMembershipType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccessReviewDecisionPrincipalResourceMembershipType. + */ + @JsonCreator + public static AccessReviewDecisionPrincipalResourceMembershipType fromString(String name) { + return fromString(name, AccessReviewDecisionPrincipalResourceMembershipType.class); + } + + /** + * Gets known AccessReviewDecisionPrincipalResourceMembershipType values. + * + * @return known AccessReviewDecisionPrincipalResourceMembershipType values. + */ + public static Collection values() { + return values(AccessReviewDecisionPrincipalResourceMembershipType.class); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionServicePrincipalIdentity.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionServicePrincipalIdentity.java new file mode 100644 index 0000000000000..38278132cc79b --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionServicePrincipalIdentity.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewDecisionIdentity; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Service Principal Decision Target. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("servicePrincipal") +@Immutable +public class AccessReviewDecisionServicePrincipalIdentity extends AccessReviewDecisionIdentity { + /* + * The appId for the service principal entity being reviewed + */ + @JsonProperty(value = "appId", access = JsonProperty.Access.WRITE_ONLY) + private String appId; + + /** + * Get the appId property: The appId for the service principal entity being reviewed. + * + * @return the appId value. + */ + public String appId() { + return this.appId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionUserIdentity.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionUserIdentity.java new file mode 100644 index 0000000000000..45f8b73e50b85 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionUserIdentity.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewDecisionIdentity; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** User Decision Target. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("user") +@Immutable +public class AccessReviewDecisionUserIdentity extends AccessReviewDecisionIdentity { + /* + * The user principal name of the user whose access was reviewed. + */ + @JsonProperty(value = "userPrincipalName", access = JsonProperty.Access.WRITE_ONLY) + private String userPrincipalName; + + /** + * Get the userPrincipalName property: The user principal name of the user whose access was reviewed. + * + * @return the userPrincipalName value. + */ + public String userPrincipalName() { + return this.userPrincipalName; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionUserSignInInsightProperties.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionUserSignInInsightProperties.java new file mode 100644 index 0000000000000..5e0cda0f287f2 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionUserSignInInsightProperties.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewDecisionInsightProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** User Decision Target. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("userSignInInsight") +@Immutable +public final class AccessReviewDecisionUserSignInInsightProperties extends AccessReviewDecisionInsightProperties { + /* + * Date Time when the user signed into the tenant. + */ + @JsonProperty(value = "lastSignInDateTime", access = JsonProperty.Access.WRITE_ONLY) + private Object lastSignInDateTime; + + /** + * Get the lastSignInDateTime property: Date Time when the user signed into the tenant. + * + * @return the lastSignInDateTime value. + */ + public Object lastSignInDateTime() { + return this.lastSignInDateTime; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDefaultSettings.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDefaultSettings.java new file mode 100644 index 0000000000000..585349712358a --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDefaultSettings.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewDefaultSettingsInner; +import java.time.Duration; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of AccessReviewDefaultSettings. */ +public interface AccessReviewDefaultSettings { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the mailNotificationsEnabled property: Flag to indicate whether sending mails to reviewers and the review + * creator is enabled. + * + * @return the mailNotificationsEnabled value. + */ + Boolean mailNotificationsEnabled(); + + /** + * Gets the reminderNotificationsEnabled property: Flag to indicate whether sending reminder emails to reviewers are + * enabled. + * + * @return the reminderNotificationsEnabled value. + */ + Boolean reminderNotificationsEnabled(); + + /** + * Gets the defaultDecisionEnabled property: Flag to indicate whether reviewers are required to provide a + * justification when reviewing access. + * + * @return the defaultDecisionEnabled value. + */ + Boolean defaultDecisionEnabled(); + + /** + * Gets the justificationRequiredOnApproval property: Flag to indicate whether the reviewer is required to pass + * justification when recording a decision. + * + * @return the justificationRequiredOnApproval value. + */ + Boolean justificationRequiredOnApproval(); + + /** + * Gets the defaultDecision property: This specifies the behavior for the autoReview feature when an access review + * completes. + * + * @return the defaultDecision value. + */ + DefaultDecisionType defaultDecision(); + + /** + * Gets the autoApplyDecisionsEnabled property: 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. + * + * @return the autoApplyDecisionsEnabled value. + */ + Boolean autoApplyDecisionsEnabled(); + + /** + * Gets the recommendationsEnabled property: Flag to indicate whether showing recommendations to reviewers is + * enabled. + * + * @return the recommendationsEnabled value. + */ + Boolean recommendationsEnabled(); + + /** + * Gets the recommendationLookBackDuration property: 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)). + * + * @return the recommendationLookBackDuration value. + */ + Duration recommendationLookBackDuration(); + + /** + * Gets the instanceDurationInDays property: The duration in days for an instance. + * + * @return the instanceDurationInDays value. + */ + Integer instanceDurationInDays(); + + /** + * Gets the typePropertiesType property: The recurrence type : weekly, monthly, etc. + * + * @return the typePropertiesType value. + */ + AccessReviewRecurrencePatternType typePropertiesType(); + + /** + * Gets the interval property: The interval for recurrence. For a quarterly review, the interval is 3 for type : + * absoluteMonthly. + * + * @return the interval value. + */ + Integer interval(); + + /** + * Gets the typeRangeType property: The recurrence range type. The possible values are: endDate, noEnd, numbered. + * + * @return the typeRangeType value. + */ + AccessReviewRecurrenceRangeType typeRangeType(); + + /** + * Gets the numberOfOccurrences property: The number of times to repeat the access review. Required and must be + * positive if type is numbered. + * + * @return the numberOfOccurrences value. + */ + Integer numberOfOccurrences(); + + /** + * Gets the startDate property: The DateTime when the review is scheduled to be start. This could be a date in the + * future. Required on create. + * + * @return the startDate value. + */ + OffsetDateTime startDate(); + + /** + * Gets the endDate property: The DateTime when the review is scheduled to end. Required if type is endDate. + * + * @return the endDate value. + */ + OffsetDateTime endDate(); + + /** + * Gets the inner com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewDefaultSettingsInner + * object. + * + * @return the inner object. + */ + AccessReviewDefaultSettingsInner innerModel(); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDefaultSettingsOperations.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDefaultSettingsOperations.java new file mode 100644 index 0000000000000..d98701e5d8ec6 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDefaultSettingsOperations.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewScheduleSettings; + +/** Resource collection API of AccessReviewDefaultSettingsOperations. */ +public interface AccessReviewDefaultSettingsOperations { + /** + * Get access review default settings for the subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review default settings for the subscription. + */ + AccessReviewDefaultSettings get(); + + /** + * Get access review default settings for the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review default settings for the subscription along with {@link Response}. + */ + Response getWithResponse(Context context); + + /** + * Get access review default settings for the subscription. + * + * @param properties Access review schedule settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review default settings for the subscription. + */ + AccessReviewDefaultSettings put(AccessReviewScheduleSettings properties); + + /** + * Get access review default settings for the subscription. + * + * @param properties Access review schedule settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review default settings for the subscription along with {@link Response}. + */ + Response putWithResponse(AccessReviewScheduleSettings properties, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryDefinition.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryDefinition.java new file mode 100644 index 0000000000000..d891ab3f7e0cb --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryDefinition.java @@ -0,0 +1,330 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryDefinitionInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryInstanceInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewScope; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of AccessReviewHistoryDefinition. */ +public interface AccessReviewHistoryDefinition { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the displayName property: The display name for the history definition. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the reviewHistoryPeriodStartDateTime property: 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. + * + * @return the reviewHistoryPeriodStartDateTime value. + */ + OffsetDateTime reviewHistoryPeriodStartDateTime(); + + /** + * Gets the reviewHistoryPeriodEndDateTime property: 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. + * + * @return the reviewHistoryPeriodEndDateTime value. + */ + OffsetDateTime reviewHistoryPeriodEndDateTime(); + + /** + * Gets the decisions property: 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. + * + * @return the decisions value. + */ + List decisions(); + + /** + * Gets the status property: This read-only field specifies the of the requested review history data. This is either + * requested, in-progress, done or error. + * + * @return the status value. + */ + AccessReviewHistoryDefinitionStatus status(); + + /** + * Gets the createdDateTime property: Date time when history definition was created. + * + * @return the createdDateTime value. + */ + OffsetDateTime createdDateTime(); + + /** + * Gets the scopes property: A collection of scopes used when selecting review history data. + * + * @return the scopes value. + */ + List scopes(); + + /** + * Gets the instances property: Set of access review history instances for this history definition. + * + * @return the instances value. + */ + List instances(); + + /** + * Gets the principalId property: The identity id. + * + * @return the principalId value. + */ + String principalId(); + + /** + * Gets the principalType property: The identity type : user/servicePrincipal. + * + * @return the principalType value. + */ + AccessReviewActorIdentityType principalType(); + + /** + * Gets the principalName property: The identity display name. + * + * @return the principalName value. + */ + String principalName(); + + /** + * Gets the userPrincipalName property: The user principal name(if valid). + * + * @return the userPrincipalName value. + */ + String userPrincipalName(); + + /** + * Gets the typePropertiesType property: The recurrence type : weekly, monthly, etc. + * + * @return the typePropertiesType value. + */ + AccessReviewRecurrencePatternType typePropertiesType(); + + /** + * Gets the interval property: The interval for recurrence. For a quarterly review, the interval is 3 for type : + * absoluteMonthly. + * + * @return the interval value. + */ + Integer interval(); + + /** + * Gets the typeRangeType property: The recurrence range type. The possible values are: endDate, noEnd, numbered. + * + * @return the typeRangeType value. + */ + AccessReviewRecurrenceRangeType typeRangeType(); + + /** + * Gets the numberOfOccurrences property: The number of times to repeat the access review. Required and must be + * positive if type is numbered. + * + * @return the numberOfOccurrences value. + */ + Integer numberOfOccurrences(); + + /** + * Gets the startDate property: The DateTime when the review is scheduled to be start. This could be a date in the + * future. Required on create. + * + * @return the startDate value. + */ + OffsetDateTime startDate(); + + /** + * Gets the endDate property: The DateTime when the review is scheduled to end. Required if type is endDate. + * + * @return the endDate value. + */ + OffsetDateTime endDate(); + + /** + * Gets the inner com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryDefinitionInner + * object. + * + * @return the inner object. + */ + AccessReviewHistoryDefinitionInner innerModel(); + + /** The entirety of the AccessReviewHistoryDefinition definition. */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCreate { + } + /** The AccessReviewHistoryDefinition definition stages. */ + interface DefinitionStages { + /** The first stage of the AccessReviewHistoryDefinition definition. */ + interface Blank extends WithCreate { + } + /** + * The stage of the AccessReviewHistoryDefinition definition which contains all the minimum required properties + * for the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithDisplayName, + DefinitionStages.WithDecisions, + DefinitionStages.WithScopes, + DefinitionStages.WithInstances, + DefinitionStages.WithType, + DefinitionStages.WithInterval, + DefinitionStages.WithTypeRangeType, + DefinitionStages.WithNumberOfOccurrences, + DefinitionStages.WithStartDate, + DefinitionStages.WithEndDate { + /** + * Executes the create request. + * + * @return the created resource. + */ + AccessReviewHistoryDefinition create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AccessReviewHistoryDefinition create(Context context); + } + /** The stage of the AccessReviewHistoryDefinition definition allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: The display name for the history definition.. + * + * @param displayName The display name for the history definition. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + /** The stage of the AccessReviewHistoryDefinition definition allowing to specify decisions. */ + interface WithDecisions { + /** + * Specifies the decisions property: 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.. + * + * @param decisions 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. + * @return the next definition stage. + */ + WithCreate withDecisions(List decisions); + } + /** The stage of the AccessReviewHistoryDefinition definition allowing to specify scopes. */ + interface WithScopes { + /** + * Specifies the scopes property: A collection of scopes used when selecting review history data. + * + * @param scopes A collection of scopes used when selecting review history data. + * @return the next definition stage. + */ + WithCreate withScopes(List scopes); + } + /** The stage of the AccessReviewHistoryDefinition definition allowing to specify instances. */ + interface WithInstances { + /** + * Specifies the instances property: Set of access review history instances for this history definition.. + * + * @param instances Set of access review history instances for this history definition. + * @return the next definition stage. + */ + WithCreate withInstances(List instances); + } + /** The stage of the AccessReviewHistoryDefinition definition allowing to specify type. */ + interface WithType { + /** + * Specifies the type property: The recurrence type : weekly, monthly, etc.. + * + * @param type The recurrence type : weekly, monthly, etc. + * @return the next definition stage. + */ + WithCreate withType(AccessReviewRecurrencePatternType type); + } + /** The stage of the AccessReviewHistoryDefinition definition allowing to specify interval. */ + interface WithInterval { + /** + * Specifies the interval property: The interval for recurrence. For a quarterly review, the interval is 3 + * for type : absoluteMonthly.. + * + * @param interval The interval for recurrence. For a quarterly review, the interval is 3 for type : + * absoluteMonthly. + * @return the next definition stage. + */ + WithCreate withInterval(Integer interval); + } + /** The stage of the AccessReviewHistoryDefinition definition allowing to specify typeRangeType. */ + interface WithTypeRangeType { + /** + * Specifies the typeRangeType property: The recurrence range type. The possible values are: endDate, noEnd, + * numbered.. + * + * @param typeRangeType The recurrence range type. The possible values are: endDate, noEnd, numbered. + * @return the next definition stage. + */ + WithCreate withTypeRangeType(AccessReviewRecurrenceRangeType typeRangeType); + } + /** The stage of the AccessReviewHistoryDefinition definition allowing to specify numberOfOccurrences. */ + interface WithNumberOfOccurrences { + /** + * Specifies the numberOfOccurrences property: The number of times to repeat the access review. Required and + * must be positive if type is numbered.. + * + * @param numberOfOccurrences The number of times to repeat the access review. Required and must be positive + * if type is numbered. + * @return the next definition stage. + */ + WithCreate withNumberOfOccurrences(Integer numberOfOccurrences); + } + /** The stage of the AccessReviewHistoryDefinition definition allowing to specify startDate. */ + interface WithStartDate { + /** + * Specifies the startDate property: The DateTime when the review is scheduled to be start. This could be a + * date in the future. Required on create.. + * + * @param startDate The DateTime when the review is scheduled to be start. This could be a date in the + * future. Required on create. + * @return the next definition stage. + */ + WithCreate withStartDate(OffsetDateTime startDate); + } + /** The stage of the AccessReviewHistoryDefinition definition allowing to specify endDate. */ + interface WithEndDate { + /** + * Specifies the endDate property: The DateTime when the review is scheduled to end. Required if type is + * endDate. + * + * @param endDate The DateTime when the review is scheduled to end. Required if type is endDate. + * @return the next definition stage. + */ + WithCreate withEndDate(OffsetDateTime endDate); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryDefinitionInstanceListResult.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryDefinitionInstanceListResult.java new file mode 100644 index 0000000000000..3f03672d56663 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryDefinitionInstanceListResult.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryInstanceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Access Review History Instances. */ +@Fluent +public final class AccessReviewHistoryDefinitionInstanceListResult { + /* + * Access Review History Definition's Instance list. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Access Review History Definition's Instance list. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Access Review History Definition's Instance list. + * + * @param value the value value to set. + * @return the AccessReviewHistoryDefinitionInstanceListResult object itself. + */ + public AccessReviewHistoryDefinitionInstanceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to use for getting the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to use for getting the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the AccessReviewHistoryDefinitionInstanceListResult object itself. + */ + public AccessReviewHistoryDefinitionInstanceListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryDefinitionInstances.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryDefinitionInstances.java new file mode 100644 index 0000000000000..c721a7e74329a --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryDefinitionInstances.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of AccessReviewHistoryDefinitionInstances. */ +public interface AccessReviewHistoryDefinitionInstances { + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review History Definition Instance. + */ + AccessReviewHistoryInstance generateDownloadUri(String historyDefinitionId, String instanceId); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review History Definition Instance along with {@link Response}. + */ + Response generateDownloadUriWithResponse( + String historyDefinitionId, String instanceId, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryDefinitionInstancesOperations.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryDefinitionInstancesOperations.java new file mode 100644 index 0000000000000..0c43e986409b9 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryDefinitionInstancesOperations.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of AccessReviewHistoryDefinitionInstancesOperations. */ +public interface AccessReviewHistoryDefinitionInstancesOperations { + /** + * Get access review history definition instances by definition Id. + * + * @param historyDefinitionId The id of the access review history definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review history definition instances by definition Id as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String historyDefinitionId); + + /** + * Get access review history definition instances by definition Id. + * + * @param historyDefinitionId The id of the access review history definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review history definition instances by definition Id as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String historyDefinitionId, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryDefinitionListResult.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryDefinitionListResult.java new file mode 100644 index 0000000000000..5c0815a2a72b7 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryDefinitionListResult.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryDefinitionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Access Review History Definitions. */ +@Fluent +public final class AccessReviewHistoryDefinitionListResult { + /* + * Access Review History Definition list. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Access Review History Definition list. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Access Review History Definition list. + * + * @param value the value value to set. + * @return the AccessReviewHistoryDefinitionListResult object itself. + */ + public AccessReviewHistoryDefinitionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to use for getting the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to use for getting the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the AccessReviewHistoryDefinitionListResult object itself. + */ + public AccessReviewHistoryDefinitionListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryDefinitionOperations.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryDefinitionOperations.java new file mode 100644 index 0000000000000..efbd76c52e745 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryDefinitionOperations.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of AccessReviewHistoryDefinitionOperations. */ +public interface AccessReviewHistoryDefinitionOperations { + /** + * Delete an access review history definition. + * + * @param historyDefinitionId The id of the access review history definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String historyDefinitionId); + + /** + * Delete an access review history definition. + * + * @param historyDefinitionId The id of the access review history definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String historyDefinitionId, Context context); + + /** + * Begins definition for a new AccessReviewHistoryDefinition resource. + * + * @param name resource name. + * @return the first stage of the new AccessReviewHistoryDefinition definition. + */ + AccessReviewHistoryDefinition.DefinitionStages.Blank define(String name); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryDefinitionStatus.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryDefinitionStatus.java new file mode 100644 index 0000000000000..da56b1af25e80 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryDefinitionStatus.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * This read-only field specifies the of the requested review history data. This is either requested, in-progress, done + * or error. + */ +public final class AccessReviewHistoryDefinitionStatus + extends ExpandableStringEnum { + /** Static value Requested for AccessReviewHistoryDefinitionStatus. */ + public static final AccessReviewHistoryDefinitionStatus REQUESTED = fromString("Requested"); + + /** Static value InProgress for AccessReviewHistoryDefinitionStatus. */ + public static final AccessReviewHistoryDefinitionStatus IN_PROGRESS = fromString("InProgress"); + + /** Static value Done for AccessReviewHistoryDefinitionStatus. */ + public static final AccessReviewHistoryDefinitionStatus DONE = fromString("Done"); + + /** Static value Error for AccessReviewHistoryDefinitionStatus. */ + public static final AccessReviewHistoryDefinitionStatus ERROR = fromString("Error"); + + /** + * Creates or finds a AccessReviewHistoryDefinitionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccessReviewHistoryDefinitionStatus. + */ + @JsonCreator + public static AccessReviewHistoryDefinitionStatus fromString(String name) { + return fromString(name, AccessReviewHistoryDefinitionStatus.class); + } + + /** + * Gets known AccessReviewHistoryDefinitionStatus values. + * + * @return known AccessReviewHistoryDefinitionStatus values. + */ + public static Collection values() { + return values(AccessReviewHistoryDefinitionStatus.class); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryDefinitions.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryDefinitions.java new file mode 100644 index 0000000000000..daa5a9ecd9341 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryDefinitions.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of AccessReviewHistoryDefinitions. */ +public interface AccessReviewHistoryDefinitions { + /** + * Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available + * for 30 days after creation. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review History Definitions as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available + * for 30 days after creation. + * + * @param filter The filter to apply on the operation. Only standard filters on definition name and created date are + * supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review History Definitions as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String filter, Context context); + + /** + * Get access review history definition by definition Id. + * + * @param historyDefinitionId The id of the access review history definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review history definition by definition Id. + */ + AccessReviewHistoryDefinition getById(String historyDefinitionId); + + /** + * Get access review history definition by definition Id. + * + * @param historyDefinitionId The id of the access review history definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review history definition by definition Id along with {@link Response}. + */ + Response getByIdWithResponse(String historyDefinitionId, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryInstance.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryInstance.java new file mode 100644 index 0000000000000..61e237b195f85 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryInstance.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryInstanceInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of AccessReviewHistoryInstance. */ +public interface AccessReviewHistoryInstance { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the reviewHistoryPeriodStartDateTime property: 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. + * + * @return the reviewHistoryPeriodStartDateTime value. + */ + OffsetDateTime reviewHistoryPeriodStartDateTime(); + + /** + * Gets the reviewHistoryPeriodEndDateTime property: 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. + * + * @return the reviewHistoryPeriodEndDateTime value. + */ + OffsetDateTime reviewHistoryPeriodEndDateTime(); + + /** + * Gets the displayName property: The display name for the parent history definition. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the status property: 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. + * + * @return the status value. + */ + AccessReviewHistoryDefinitionStatus status(); + + /** + * Gets the runDateTime property: Date time when the history data report is scheduled to be generated. + * + * @return the runDateTime value. + */ + OffsetDateTime runDateTime(); + + /** + * Gets the fulfilledDateTime property: Date time when the history data report is scheduled to be generated. + * + * @return the fulfilledDateTime value. + */ + OffsetDateTime fulfilledDateTime(); + + /** + * Gets the downloadUri property: 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. + * + * @return the downloadUri value. + */ + String downloadUri(); + + /** + * Gets the expiration property: Date time when history data report expires and the associated data is deleted. + * + * @return the expiration value. + */ + OffsetDateTime expiration(); + + /** + * Gets the inner com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryInstanceInner + * object. + * + * @return the inner object. + */ + AccessReviewHistoryInstanceInner innerModel(); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstance.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstance.java new file mode 100644 index 0000000000000..15ee90ce52900 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstance.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewInstanceInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of AccessReviewInstance. */ +public interface AccessReviewInstance { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the status property: This read-only field specifies the status of an access review instance. + * + * @return the status value. + */ + AccessReviewInstanceStatus status(); + + /** + * Gets the startDateTime property: The DateTime when the review instance is scheduled to be start. + * + * @return the startDateTime value. + */ + OffsetDateTime startDateTime(); + + /** + * Gets the endDateTime property: The DateTime when the review instance is scheduled to end. + * + * @return the endDateTime value. + */ + OffsetDateTime endDateTime(); + + /** + * Gets the reviewers property: This is the collection of reviewers. + * + * @return the reviewers value. + */ + List reviewers(); + + /** + * Gets the backupReviewers property: This is the collection of backup reviewers. + * + * @return the backupReviewers value. + */ + List backupReviewers(); + + /** + * Gets the reviewersType property: 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. + * + * @return the reviewersType value. + */ + AccessReviewInstanceReviewersType reviewersType(); + + /** + * Gets the inner com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewInstanceInner object. + * + * @return the inner object. + */ + AccessReviewInstanceInner innerModel(); + + /** The entirety of the AccessReviewInstance definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The AccessReviewInstance definition stages. */ + interface DefinitionStages { + /** The first stage of the AccessReviewInstance definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the AccessReviewInstance definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies scheduleDefinitionId. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @return the next definition stage. + */ + WithCreate withExistingAccessReviewScheduleDefinition(String scheduleDefinitionId); + } + /** + * The stage of the AccessReviewInstance definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithStartDateTime, + DefinitionStages.WithEndDateTime, + DefinitionStages.WithReviewers, + DefinitionStages.WithBackupReviewers { + /** + * Executes the create request. + * + * @return the created resource. + */ + AccessReviewInstance create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AccessReviewInstance create(Context context); + } + /** The stage of the AccessReviewInstance definition allowing to specify startDateTime. */ + interface WithStartDateTime { + /** + * Specifies the startDateTime property: The DateTime when the review instance is scheduled to be start.. + * + * @param startDateTime The DateTime when the review instance is scheduled to be start. + * @return the next definition stage. + */ + WithCreate withStartDateTime(OffsetDateTime startDateTime); + } + /** The stage of the AccessReviewInstance definition allowing to specify endDateTime. */ + interface WithEndDateTime { + /** + * Specifies the endDateTime property: The DateTime when the review instance is scheduled to end.. + * + * @param endDateTime The DateTime when the review instance is scheduled to end. + * @return the next definition stage. + */ + WithCreate withEndDateTime(OffsetDateTime endDateTime); + } + /** The stage of the AccessReviewInstance definition allowing to specify reviewers. */ + interface WithReviewers { + /** + * Specifies the reviewers property: This is the collection of reviewers.. + * + * @param reviewers This is the collection of reviewers. + * @return the next definition stage. + */ + WithCreate withReviewers(List reviewers); + } + /** The stage of the AccessReviewInstance definition allowing to specify backupReviewers. */ + interface WithBackupReviewers { + /** + * Specifies the backupReviewers property: This is the collection of backup reviewers.. + * + * @param backupReviewers This is the collection of backup reviewers. + * @return the next definition stage. + */ + WithCreate withBackupReviewers(List backupReviewers); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AccessReviewInstance refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AccessReviewInstance refresh(Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstanceContactedReviewers.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstanceContactedReviewers.java new file mode 100644 index 0000000000000..80a944224d7d2 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstanceContactedReviewers.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of AccessReviewInstanceContactedReviewers. */ +public 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance contacted reviewers as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String scheduleDefinitionId, String id); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance contacted reviewers as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String scheduleDefinitionId, String id, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstanceDecisions.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstanceDecisions.java new file mode 100644 index 0000000000000..d8a236a4bc2f3 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstanceDecisions.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of AccessReviewInstanceDecisions. */ +public 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance decisions as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String scheduleDefinitionId, String id); + + /** + * 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 filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance decisions as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String scheduleDefinitionId, String id, String filter, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstanceListResult.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstanceListResult.java new file mode 100644 index 0000000000000..f2bbdb2549837 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstanceListResult.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewInstanceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Access Review Instances. */ +@Fluent +public final class AccessReviewInstanceListResult { + /* + * Access Review Instance list. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Access Review Instance list. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Access Review Instance list. + * + * @param value the value value to set. + * @return the AccessReviewInstanceListResult object itself. + */ + public AccessReviewInstanceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to use for getting the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to use for getting the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the AccessReviewInstanceListResult object itself. + */ + public AccessReviewInstanceListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstanceMyDecisions.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstanceMyDecisions.java new file mode 100644 index 0000000000000..839e1469327e2 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstanceMyDecisions.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewDecisionProperties; + +/** Resource collection API of AccessReviewInstanceMyDecisions. */ +public 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return my access review instance decisions as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String scheduleDefinitionId, String id); + + /** + * 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 filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return my access review instance decisions as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String scheduleDefinitionId, String id, String filter, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return my single access review instance decision. + */ + AccessReviewDecision getById(String scheduleDefinitionId, String id, String decisionId); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return my single access review instance decision along with {@link Response}. + */ + Response getByIdWithResponse( + String scheduleDefinitionId, String id, String decisionId, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review. + */ + AccessReviewDecision patch( + String scheduleDefinitionId, String id, String decisionId, AccessReviewDecisionProperties properties); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review along with {@link Response}. + */ + Response patchWithResponse( + String scheduleDefinitionId, + String id, + String decisionId, + AccessReviewDecisionProperties properties, + Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstanceOperations.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstanceOperations.java new file mode 100644 index 0000000000000..2b0298821374a --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstanceOperations.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of AccessReviewInstanceOperations. */ +public 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(String scheduleDefinitionId, String id); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response stopWithResponse(String scheduleDefinitionId, String id, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resetDecisions(String scheduleDefinitionId, String id); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response resetDecisionsWithResponse(String scheduleDefinitionId, String id, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void applyDecisions(String scheduleDefinitionId, String id); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response applyDecisionsWithResponse(String scheduleDefinitionId, String id, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void sendReminders(String scheduleDefinitionId, String id); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response sendRemindersWithResponse(String scheduleDefinitionId, String id, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void acceptRecommendations(String scheduleDefinitionId, String id); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response acceptRecommendationsWithResponse(String scheduleDefinitionId, String id, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstanceReviewersType.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstanceReviewersType.java new file mode 100644 index 0000000000000..a875bdcd7eb25 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstanceReviewersType.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * 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. + */ +public final class AccessReviewInstanceReviewersType extends ExpandableStringEnum { + /** Static value Assigned for AccessReviewInstanceReviewersType. */ + public static final AccessReviewInstanceReviewersType ASSIGNED = fromString("Assigned"); + + /** Static value Self for AccessReviewInstanceReviewersType. */ + public static final AccessReviewInstanceReviewersType SELF = fromString("Self"); + + /** Static value Managers for AccessReviewInstanceReviewersType. */ + public static final AccessReviewInstanceReviewersType MANAGERS = fromString("Managers"); + + /** + * Creates or finds a AccessReviewInstanceReviewersType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccessReviewInstanceReviewersType. + */ + @JsonCreator + public static AccessReviewInstanceReviewersType fromString(String name) { + return fromString(name, AccessReviewInstanceReviewersType.class); + } + + /** + * Gets known AccessReviewInstanceReviewersType values. + * + * @return known AccessReviewInstanceReviewersType values. + */ + public static Collection values() { + return values(AccessReviewInstanceReviewersType.class); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstanceStatus.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstanceStatus.java new file mode 100644 index 0000000000000..23baefacd4d14 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstanceStatus.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** This read-only field specifies the status of an access review instance. */ +public final class AccessReviewInstanceStatus extends ExpandableStringEnum { + /** Static value NotStarted for AccessReviewInstanceStatus. */ + public static final AccessReviewInstanceStatus NOT_STARTED = fromString("NotStarted"); + + /** Static value InProgress for AccessReviewInstanceStatus. */ + public static final AccessReviewInstanceStatus IN_PROGRESS = fromString("InProgress"); + + /** Static value Completed for AccessReviewInstanceStatus. */ + public static final AccessReviewInstanceStatus COMPLETED = fromString("Completed"); + + /** Static value Applied for AccessReviewInstanceStatus. */ + public static final AccessReviewInstanceStatus APPLIED = fromString("Applied"); + + /** Static value Initializing for AccessReviewInstanceStatus. */ + public static final AccessReviewInstanceStatus INITIALIZING = fromString("Initializing"); + + /** Static value Applying for AccessReviewInstanceStatus. */ + public static final AccessReviewInstanceStatus APPLYING = fromString("Applying"); + + /** Static value Completing for AccessReviewInstanceStatus. */ + public static final AccessReviewInstanceStatus COMPLETING = fromString("Completing"); + + /** Static value Scheduled for AccessReviewInstanceStatus. */ + public static final AccessReviewInstanceStatus SCHEDULED = fromString("Scheduled"); + + /** Static value AutoReviewing for AccessReviewInstanceStatus. */ + public static final AccessReviewInstanceStatus AUTO_REVIEWING = fromString("AutoReviewing"); + + /** Static value AutoReviewed for AccessReviewInstanceStatus. */ + public static final AccessReviewInstanceStatus AUTO_REVIEWED = fromString("AutoReviewed"); + + /** Static value Starting for AccessReviewInstanceStatus. */ + public static final AccessReviewInstanceStatus STARTING = fromString("Starting"); + + /** + * Creates or finds a AccessReviewInstanceStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccessReviewInstanceStatus. + */ + @JsonCreator + public static AccessReviewInstanceStatus fromString(String name) { + return fromString(name, AccessReviewInstanceStatus.class); + } + + /** + * Gets known AccessReviewInstanceStatus values. + * + * @return known AccessReviewInstanceStatus values. + */ + public static Collection values() { + return values(AccessReviewInstanceStatus.class); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstances.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstances.java new file mode 100644 index 0000000000000..4832e5a56025f --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstances.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of AccessReviewInstances. */ +public interface AccessReviewInstances { + /** + * Get access review instances. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String scheduleDefinitionId); + + /** + * Get access review instances. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String scheduleDefinitionId, String filter, Context context); + + /** + * Get access review instances. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances. + */ + AccessReviewInstance getById(String scheduleDefinitionId, String id); + + /** + * Get access review instances. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances along with {@link Response}. + */ + Response getByIdWithResponse(String scheduleDefinitionId, String id, Context context); + + /** + * Begins definition for a new AccessReviewInstance resource. + * + * @param name resource name. + * @return the first stage of the new AccessReviewInstance definition. + */ + AccessReviewInstance.DefinitionStages.Blank define(String name); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstancesAssignedForMyApprovals.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstancesAssignedForMyApprovals.java new file mode 100644 index 0000000000000..1f6c14f844404 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstancesAssignedForMyApprovals.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of AccessReviewInstancesAssignedForMyApprovals. */ +public interface AccessReviewInstancesAssignedForMyApprovals { + /** + * Get access review instances assigned for my approval. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances assigned for my approval as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String scheduleDefinitionId); + + /** + * Get access review instances assigned for my approval. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances assigned for my approval as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String scheduleDefinitionId, String filter, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single access review instance assigned for my approval. + */ + AccessReviewInstance getById(String scheduleDefinitionId, String id); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single access review instance assigned for my approval along with {@link Response}. + */ + Response getByIdWithResponse(String scheduleDefinitionId, String id, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewRecurrencePatternType.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewRecurrencePatternType.java new file mode 100644 index 0000000000000..860f6f6daab6d --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewRecurrencePatternType.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The recurrence type : weekly, monthly, etc. */ +public final class AccessReviewRecurrencePatternType extends ExpandableStringEnum { + /** Static value weekly for AccessReviewRecurrencePatternType. */ + public static final AccessReviewRecurrencePatternType WEEKLY = fromString("weekly"); + + /** Static value absoluteMonthly for AccessReviewRecurrencePatternType. */ + public static final AccessReviewRecurrencePatternType ABSOLUTE_MONTHLY = fromString("absoluteMonthly"); + + /** + * Creates or finds a AccessReviewRecurrencePatternType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccessReviewRecurrencePatternType. + */ + @JsonCreator + public static AccessReviewRecurrencePatternType fromString(String name) { + return fromString(name, AccessReviewRecurrencePatternType.class); + } + + /** + * Gets known AccessReviewRecurrencePatternType values. + * + * @return known AccessReviewRecurrencePatternType values. + */ + public static Collection values() { + return values(AccessReviewRecurrencePatternType.class); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewRecurrenceRangeType.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewRecurrenceRangeType.java new file mode 100644 index 0000000000000..17c7e497e0233 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewRecurrenceRangeType.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The recurrence range type. The possible values are: endDate, noEnd, numbered. */ +public final class AccessReviewRecurrenceRangeType extends ExpandableStringEnum { + /** Static value endDate for AccessReviewRecurrenceRangeType. */ + public static final AccessReviewRecurrenceRangeType END_DATE = fromString("endDate"); + + /** Static value noEnd for AccessReviewRecurrenceRangeType. */ + public static final AccessReviewRecurrenceRangeType NO_END = fromString("noEnd"); + + /** Static value numbered for AccessReviewRecurrenceRangeType. */ + public static final AccessReviewRecurrenceRangeType NUMBERED = fromString("numbered"); + + /** + * Creates or finds a AccessReviewRecurrenceRangeType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccessReviewRecurrenceRangeType. + */ + @JsonCreator + public static AccessReviewRecurrenceRangeType fromString(String name) { + return fromString(name, AccessReviewRecurrenceRangeType.class); + } + + /** + * Gets known AccessReviewRecurrenceRangeType values. + * + * @return known AccessReviewRecurrenceRangeType values. + */ + public static Collection values() { + return values(AccessReviewRecurrenceRangeType.class); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewResult.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewResult.java new file mode 100644 index 0000000000000..d70950998b994 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewResult.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Represents a reviewer's decision for a given review. */ +public final class AccessReviewResult extends ExpandableStringEnum { + /** Static value Approve for AccessReviewResult. */ + public static final AccessReviewResult APPROVE = fromString("Approve"); + + /** Static value Deny for AccessReviewResult. */ + public static final AccessReviewResult DENY = fromString("Deny"); + + /** Static value NotReviewed for AccessReviewResult. */ + public static final AccessReviewResult NOT_REVIEWED = fromString("NotReviewed"); + + /** Static value DontKnow for AccessReviewResult. */ + public static final AccessReviewResult DONT_KNOW = fromString("DontKnow"); + + /** Static value NotNotified for AccessReviewResult. */ + public static final AccessReviewResult NOT_NOTIFIED = fromString("NotNotified"); + + /** + * Creates or finds a AccessReviewResult from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccessReviewResult. + */ + @JsonCreator + public static AccessReviewResult fromString(String name) { + return fromString(name, AccessReviewResult.class); + } + + /** + * Gets known AccessReviewResult values. + * + * @return known AccessReviewResult values. + */ + public static Collection values() { + return values(AccessReviewResult.class); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewReviewer.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewReviewer.java new file mode 100644 index 0000000000000..4ac7811b6581f --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewReviewer.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Descriptor for what needs to be reviewed. */ +@Fluent +public final class AccessReviewReviewer { + /* + * The id of the reviewer(user/servicePrincipal) + */ + @JsonProperty(value = "principalId") + private String principalId; + + /* + * The identity type : user/servicePrincipal + */ + @JsonProperty(value = "principalType", access = JsonProperty.Access.WRITE_ONLY) + private AccessReviewReviewerType principalType; + + /** + * Get the principalId property: The id of the reviewer(user/servicePrincipal). + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: The id of the reviewer(user/servicePrincipal). + * + * @param principalId the principalId value to set. + * @return the AccessReviewReviewer object itself. + */ + public AccessReviewReviewer withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the principalType property: The identity type : user/servicePrincipal. + * + * @return the principalType value. + */ + public AccessReviewReviewerType principalType() { + return this.principalType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewReviewerType.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewReviewerType.java new file mode 100644 index 0000000000000..2dbc293dedd52 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewReviewerType.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The identity type : user/servicePrincipal. */ +public final class AccessReviewReviewerType extends ExpandableStringEnum { + /** Static value user for AccessReviewReviewerType. */ + public static final AccessReviewReviewerType USER = fromString("user"); + + /** Static value servicePrincipal for AccessReviewReviewerType. */ + public static final AccessReviewReviewerType SERVICE_PRINCIPAL = fromString("servicePrincipal"); + + /** + * Creates or finds a AccessReviewReviewerType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccessReviewReviewerType. + */ + @JsonCreator + public static AccessReviewReviewerType fromString(String name) { + return fromString(name, AccessReviewReviewerType.class); + } + + /** + * Gets known AccessReviewReviewerType values. + * + * @return known AccessReviewReviewerType values. + */ + public static Collection values() { + return values(AccessReviewReviewerType.class); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewScheduleDefinition.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewScheduleDefinition.java new file mode 100644 index 0000000000000..c8b0626968037 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewScheduleDefinition.java @@ -0,0 +1,964 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewInstanceInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewScheduleDefinitionInner; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of AccessReviewScheduleDefinition. */ +public interface AccessReviewScheduleDefinition { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the displayName property: The display name for the schedule definition. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the status property: This read-only field specifies the status of an accessReview. + * + * @return the status value. + */ + AccessReviewScheduleDefinitionStatus status(); + + /** + * Gets the descriptionForAdmins property: The description provided by the access review creator and visible to + * admins. + * + * @return the descriptionForAdmins value. + */ + String descriptionForAdmins(); + + /** + * Gets the descriptionForReviewers property: The description provided by the access review creator to be shown to + * reviewers. + * + * @return the descriptionForReviewers value. + */ + String descriptionForReviewers(); + + /** + * Gets the reviewers property: This is the collection of reviewers. + * + * @return the reviewers value. + */ + List reviewers(); + + /** + * Gets the backupReviewers property: This is the collection of backup reviewers. + * + * @return the backupReviewers value. + */ + List backupReviewers(); + + /** + * Gets the reviewersType property: 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. + * + * @return the reviewersType value. + */ + AccessReviewScheduleDefinitionReviewersType reviewersType(); + + /** + * Gets the instances property: This is the collection of instances returned when one does an expand on it. + * + * @return the instances value. + */ + List instances(); + + /** + * Gets the principalId property: The identity id. + * + * @return the principalId value. + */ + String principalId(); + + /** + * Gets the principalType property: The identity type : user/servicePrincipal. + * + * @return the principalType value. + */ + AccessReviewActorIdentityType principalType(); + + /** + * Gets the principalName property: The identity display name. + * + * @return the principalName value. + */ + String principalName(); + + /** + * Gets the userPrincipalName property: The user principal name(if valid). + * + * @return the userPrincipalName value. + */ + String userPrincipalName(); + + /** + * Gets the mailNotificationsEnabled property: Flag to indicate whether sending mails to reviewers and the review + * creator is enabled. + * + * @return the mailNotificationsEnabled value. + */ + Boolean mailNotificationsEnabled(); + + /** + * Gets the reminderNotificationsEnabled property: Flag to indicate whether sending reminder emails to reviewers are + * enabled. + * + * @return the reminderNotificationsEnabled value. + */ + Boolean reminderNotificationsEnabled(); + + /** + * Gets the defaultDecisionEnabled property: Flag to indicate whether reviewers are required to provide a + * justification when reviewing access. + * + * @return the defaultDecisionEnabled value. + */ + Boolean defaultDecisionEnabled(); + + /** + * Gets the justificationRequiredOnApproval property: Flag to indicate whether the reviewer is required to pass + * justification when recording a decision. + * + * @return the justificationRequiredOnApproval value. + */ + Boolean justificationRequiredOnApproval(); + + /** + * Gets the defaultDecision property: This specifies the behavior for the autoReview feature when an access review + * completes. + * + * @return the defaultDecision value. + */ + DefaultDecisionType defaultDecision(); + + /** + * Gets the autoApplyDecisionsEnabled property: 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. + * + * @return the autoApplyDecisionsEnabled value. + */ + Boolean autoApplyDecisionsEnabled(); + + /** + * Gets the recommendationsEnabled property: Flag to indicate whether showing recommendations to reviewers is + * enabled. + * + * @return the recommendationsEnabled value. + */ + Boolean recommendationsEnabled(); + + /** + * Gets the recommendationLookBackDuration property: 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)). + * + * @return the recommendationLookBackDuration value. + */ + Duration recommendationLookBackDuration(); + + /** + * Gets the instanceDurationInDays property: The duration in days for an instance. + * + * @return the instanceDurationInDays value. + */ + Integer instanceDurationInDays(); + + /** + * Gets the typePropertiesType property: The recurrence type : weekly, monthly, etc. + * + * @return the typePropertiesType value. + */ + AccessReviewRecurrencePatternType typePropertiesType(); + + /** + * Gets the interval property: The interval for recurrence. For a quarterly review, the interval is 3 for type : + * absoluteMonthly. + * + * @return the interval value. + */ + Integer interval(); + + /** + * Gets the typeRangeType property: The recurrence range type. The possible values are: endDate, noEnd, numbered. + * + * @return the typeRangeType value. + */ + AccessReviewRecurrenceRangeType typeRangeType(); + + /** + * Gets the numberOfOccurrences property: The number of times to repeat the access review. Required and must be + * positive if type is numbered. + * + * @return the numberOfOccurrences value. + */ + Integer numberOfOccurrences(); + + /** + * Gets the startDate property: The DateTime when the review is scheduled to be start. This could be a date in the + * future. Required on create. + * + * @return the startDate value. + */ + OffsetDateTime startDate(); + + /** + * Gets the endDate property: The DateTime when the review is scheduled to end. Required if type is endDate. + * + * @return the endDate value. + */ + OffsetDateTime endDate(); + + /** + * Gets the resourceId property: ResourceId in which this review is getting created. + * + * @return the resourceId value. + */ + String resourceId(); + + /** + * Gets the roleDefinitionId property: This is used to indicate the role being reviewed. + * + * @return the roleDefinitionId value. + */ + String roleDefinitionId(); + + /** + * Gets the principalTypeScopePrincipalType property: The identity type user/servicePrincipal to review. + * + * @return the principalTypeScopePrincipalType value. + */ + AccessReviewScopePrincipalType principalTypeScopePrincipalType(); + + /** + * Gets the assignmentState property: The role assignment state eligible/active to review. + * + * @return the assignmentState value. + */ + AccessReviewScopeAssignmentState assignmentState(); + + /** + * Gets the inactiveDuration property: 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)). + * + * @return the inactiveDuration value. + */ + Duration inactiveDuration(); + + /** + * Gets the expandNestedMemberships property: Flag to indicate whether to expand nested memberships or not. + * + * @return the expandNestedMemberships value. + */ + Boolean expandNestedMemberships(); + + /** + * Gets the includeInheritedAccess property: Flag to indicate whether to expand nested memberships or not. + * + * @return the includeInheritedAccess value. + */ + Boolean includeInheritedAccess(); + + /** + * Gets the includeAccessBelowResource property: Flag to indicate whether to expand nested memberships or not. + * + * @return the includeAccessBelowResource value. + */ + Boolean includeAccessBelowResource(); + + /** + * Gets the excludeResourceId property: This is used to indicate the resource id(s) to exclude. + * + * @return the excludeResourceId value. + */ + String excludeResourceId(); + + /** + * Gets the excludeRoleDefinitionId property: This is used to indicate the role definition id(s) to exclude. + * + * @return the excludeRoleDefinitionId value. + */ + String excludeRoleDefinitionId(); + + /** + * Gets the inner + * com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewScheduleDefinitionInner object. + * + * @return the inner object. + */ + AccessReviewScheduleDefinitionInner innerModel(); + + /** The entirety of the AccessReviewScheduleDefinition definition. */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCreate { + } + /** The AccessReviewScheduleDefinition definition stages. */ + interface DefinitionStages { + /** The first stage of the AccessReviewScheduleDefinition definition. */ + interface Blank extends WithCreate { + } + /** + * The stage of the AccessReviewScheduleDefinition definition which contains all the minimum required properties + * for the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithDisplayName, + DefinitionStages.WithDescriptionForAdmins, + DefinitionStages.WithDescriptionForReviewers, + DefinitionStages.WithReviewers, + DefinitionStages.WithBackupReviewers, + DefinitionStages.WithInstances, + DefinitionStages.WithMailNotificationsEnabled, + DefinitionStages.WithReminderNotificationsEnabled, + DefinitionStages.WithDefaultDecisionEnabled, + DefinitionStages.WithJustificationRequiredOnApproval, + DefinitionStages.WithDefaultDecision, + DefinitionStages.WithAutoApplyDecisionsEnabled, + DefinitionStages.WithRecommendationsEnabled, + DefinitionStages.WithRecommendationLookBackDuration, + DefinitionStages.WithInstanceDurationInDays, + DefinitionStages.WithType, + DefinitionStages.WithInterval, + DefinitionStages.WithTypeRangeType, + DefinitionStages.WithNumberOfOccurrences, + DefinitionStages.WithStartDate, + DefinitionStages.WithEndDate { + /** + * Executes the create request. + * + * @return the created resource. + */ + AccessReviewScheduleDefinition create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AccessReviewScheduleDefinition create(Context context); + } + /** The stage of the AccessReviewScheduleDefinition definition allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: The display name for the schedule definition.. + * + * @param displayName The display name for the schedule definition. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + /** The stage of the AccessReviewScheduleDefinition definition allowing to specify descriptionForAdmins. */ + interface WithDescriptionForAdmins { + /** + * Specifies the descriptionForAdmins property: The description provided by the access review creator and + * visible to admins.. + * + * @param descriptionForAdmins The description provided by the access review creator and visible to admins. + * @return the next definition stage. + */ + WithCreate withDescriptionForAdmins(String descriptionForAdmins); + } + /** The stage of the AccessReviewScheduleDefinition definition allowing to specify descriptionForReviewers. */ + interface WithDescriptionForReviewers { + /** + * Specifies the descriptionForReviewers property: The description provided by the access review creator to + * be shown to reviewers.. + * + * @param descriptionForReviewers The description provided by the access review creator to be shown to + * reviewers. + * @return the next definition stage. + */ + WithCreate withDescriptionForReviewers(String descriptionForReviewers); + } + /** The stage of the AccessReviewScheduleDefinition definition allowing to specify reviewers. */ + interface WithReviewers { + /** + * Specifies the reviewers property: This is the collection of reviewers.. + * + * @param reviewers This is the collection of reviewers. + * @return the next definition stage. + */ + WithCreate withReviewers(List reviewers); + } + /** The stage of the AccessReviewScheduleDefinition definition allowing to specify backupReviewers. */ + interface WithBackupReviewers { + /** + * Specifies the backupReviewers property: This is the collection of backup reviewers.. + * + * @param backupReviewers This is the collection of backup reviewers. + * @return the next definition stage. + */ + WithCreate withBackupReviewers(List backupReviewers); + } + /** The stage of the AccessReviewScheduleDefinition definition allowing to specify instances. */ + interface WithInstances { + /** + * Specifies the instances property: This is the collection of instances returned when one does an expand on + * it.. + * + * @param instances This is the collection of instances returned when one does an expand on it. + * @return the next definition stage. + */ + WithCreate withInstances(List instances); + } + /** The stage of the AccessReviewScheduleDefinition definition allowing to specify mailNotificationsEnabled. */ + interface WithMailNotificationsEnabled { + /** + * Specifies the mailNotificationsEnabled property: Flag to indicate whether sending mails to reviewers and + * the review creator is enabled.. + * + * @param mailNotificationsEnabled Flag to indicate whether sending mails to reviewers and the review + * creator is enabled. + * @return the next definition stage. + */ + WithCreate withMailNotificationsEnabled(Boolean mailNotificationsEnabled); + } + /** + * The stage of the AccessReviewScheduleDefinition definition allowing to specify reminderNotificationsEnabled. + */ + interface WithReminderNotificationsEnabled { + /** + * Specifies the reminderNotificationsEnabled property: Flag to indicate whether sending reminder emails to + * reviewers are enabled.. + * + * @param reminderNotificationsEnabled Flag to indicate whether sending reminder emails to reviewers are + * enabled. + * @return the next definition stage. + */ + WithCreate withReminderNotificationsEnabled(Boolean reminderNotificationsEnabled); + } + /** The stage of the AccessReviewScheduleDefinition definition allowing to specify defaultDecisionEnabled. */ + interface WithDefaultDecisionEnabled { + /** + * Specifies the defaultDecisionEnabled property: Flag to indicate whether reviewers are required to provide + * a justification when reviewing access.. + * + * @param defaultDecisionEnabled Flag to indicate whether reviewers are required to provide a justification + * when reviewing access. + * @return the next definition stage. + */ + WithCreate withDefaultDecisionEnabled(Boolean defaultDecisionEnabled); + } + /** + * The stage of the AccessReviewScheduleDefinition definition allowing to specify + * justificationRequiredOnApproval. + */ + interface WithJustificationRequiredOnApproval { + /** + * Specifies the justificationRequiredOnApproval property: Flag to indicate whether the reviewer is required + * to pass justification when recording a decision.. + * + * @param justificationRequiredOnApproval Flag to indicate whether the reviewer is required to pass + * justification when recording a decision. + * @return the next definition stage. + */ + WithCreate withJustificationRequiredOnApproval(Boolean justificationRequiredOnApproval); + } + /** The stage of the AccessReviewScheduleDefinition definition allowing to specify defaultDecision. */ + interface WithDefaultDecision { + /** + * Specifies the defaultDecision property: This specifies the behavior for the autoReview feature when an + * access review completes.. + * + * @param defaultDecision This specifies the behavior for the autoReview feature when an access review + * completes. + * @return the next definition stage. + */ + WithCreate withDefaultDecision(DefaultDecisionType defaultDecision); + } + /** The stage of the AccessReviewScheduleDefinition definition allowing to specify autoApplyDecisionsEnabled. */ + interface WithAutoApplyDecisionsEnabled { + /** + * Specifies the autoApplyDecisionsEnabled property: 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.. + * + * @param autoApplyDecisionsEnabled 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. + * @return the next definition stage. + */ + WithCreate withAutoApplyDecisionsEnabled(Boolean autoApplyDecisionsEnabled); + } + /** The stage of the AccessReviewScheduleDefinition definition allowing to specify recommendationsEnabled. */ + interface WithRecommendationsEnabled { + /** + * Specifies the recommendationsEnabled property: Flag to indicate whether showing recommendations to + * reviewers is enabled.. + * + * @param recommendationsEnabled Flag to indicate whether showing recommendations to reviewers is enabled. + * @return the next definition stage. + */ + WithCreate withRecommendationsEnabled(Boolean recommendationsEnabled); + } + /** + * The stage of the AccessReviewScheduleDefinition definition allowing to specify + * recommendationLookBackDuration. + */ + interface WithRecommendationLookBackDuration { + /** + * Specifies the recommendationLookBackDuration property: 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)). + * + * @param recommendationLookBackDuration 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)). + * @return the next definition stage. + */ + WithCreate withRecommendationLookBackDuration(Duration recommendationLookBackDuration); + } + /** The stage of the AccessReviewScheduleDefinition definition allowing to specify instanceDurationInDays. */ + interface WithInstanceDurationInDays { + /** + * Specifies the instanceDurationInDays property: The duration in days for an instance.. + * + * @param instanceDurationInDays The duration in days for an instance. + * @return the next definition stage. + */ + WithCreate withInstanceDurationInDays(Integer instanceDurationInDays); + } + /** The stage of the AccessReviewScheduleDefinition definition allowing to specify type. */ + interface WithType { + /** + * Specifies the type property: The recurrence type : weekly, monthly, etc.. + * + * @param type The recurrence type : weekly, monthly, etc. + * @return the next definition stage. + */ + WithCreate withType(AccessReviewRecurrencePatternType type); + } + /** The stage of the AccessReviewScheduleDefinition definition allowing to specify interval. */ + interface WithInterval { + /** + * Specifies the interval property: The interval for recurrence. For a quarterly review, the interval is 3 + * for type : absoluteMonthly.. + * + * @param interval The interval for recurrence. For a quarterly review, the interval is 3 for type : + * absoluteMonthly. + * @return the next definition stage. + */ + WithCreate withInterval(Integer interval); + } + /** The stage of the AccessReviewScheduleDefinition definition allowing to specify typeRangeType. */ + interface WithTypeRangeType { + /** + * Specifies the typeRangeType property: The recurrence range type. The possible values are: endDate, noEnd, + * numbered.. + * + * @param typeRangeType The recurrence range type. The possible values are: endDate, noEnd, numbered. + * @return the next definition stage. + */ + WithCreate withTypeRangeType(AccessReviewRecurrenceRangeType typeRangeType); + } + /** The stage of the AccessReviewScheduleDefinition definition allowing to specify numberOfOccurrences. */ + interface WithNumberOfOccurrences { + /** + * Specifies the numberOfOccurrences property: The number of times to repeat the access review. Required and + * must be positive if type is numbered.. + * + * @param numberOfOccurrences The number of times to repeat the access review. Required and must be positive + * if type is numbered. + * @return the next definition stage. + */ + WithCreate withNumberOfOccurrences(Integer numberOfOccurrences); + } + /** The stage of the AccessReviewScheduleDefinition definition allowing to specify startDate. */ + interface WithStartDate { + /** + * Specifies the startDate property: The DateTime when the review is scheduled to be start. This could be a + * date in the future. Required on create.. + * + * @param startDate The DateTime when the review is scheduled to be start. This could be a date in the + * future. Required on create. + * @return the next definition stage. + */ + WithCreate withStartDate(OffsetDateTime startDate); + } + /** The stage of the AccessReviewScheduleDefinition definition allowing to specify endDate. */ + interface WithEndDate { + /** + * Specifies the endDate property: The DateTime when the review is scheduled to end. Required if type is + * endDate. + * + * @param endDate The DateTime when the review is scheduled to end. Required if type is endDate. + * @return the next definition stage. + */ + WithCreate withEndDate(OffsetDateTime endDate); + } + } + /** + * Begins update for the AccessReviewScheduleDefinition resource. + * + * @return the stage of resource update. + */ + AccessReviewScheduleDefinition.Update update(); + + /** The template for AccessReviewScheduleDefinition update. */ + interface Update + extends UpdateStages.WithDisplayName, + UpdateStages.WithDescriptionForAdmins, + UpdateStages.WithDescriptionForReviewers, + UpdateStages.WithReviewers, + UpdateStages.WithBackupReviewers, + UpdateStages.WithInstances, + UpdateStages.WithMailNotificationsEnabled, + UpdateStages.WithReminderNotificationsEnabled, + UpdateStages.WithDefaultDecisionEnabled, + UpdateStages.WithJustificationRequiredOnApproval, + UpdateStages.WithDefaultDecision, + UpdateStages.WithAutoApplyDecisionsEnabled, + UpdateStages.WithRecommendationsEnabled, + UpdateStages.WithRecommendationLookBackDuration, + UpdateStages.WithInstanceDurationInDays, + UpdateStages.WithType, + UpdateStages.WithInterval, + UpdateStages.WithTypeRangeType, + UpdateStages.WithNumberOfOccurrences, + UpdateStages.WithStartDate, + UpdateStages.WithEndDate { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AccessReviewScheduleDefinition apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AccessReviewScheduleDefinition apply(Context context); + } + /** The AccessReviewScheduleDefinition update stages. */ + interface UpdateStages { + /** The stage of the AccessReviewScheduleDefinition update allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: The display name for the schedule definition.. + * + * @param displayName The display name for the schedule definition. + * @return the next definition stage. + */ + Update withDisplayName(String displayName); + } + /** The stage of the AccessReviewScheduleDefinition update allowing to specify descriptionForAdmins. */ + interface WithDescriptionForAdmins { + /** + * Specifies the descriptionForAdmins property: The description provided by the access review creator and + * visible to admins.. + * + * @param descriptionForAdmins The description provided by the access review creator and visible to admins. + * @return the next definition stage. + */ + Update withDescriptionForAdmins(String descriptionForAdmins); + } + /** The stage of the AccessReviewScheduleDefinition update allowing to specify descriptionForReviewers. */ + interface WithDescriptionForReviewers { + /** + * Specifies the descriptionForReviewers property: The description provided by the access review creator to + * be shown to reviewers.. + * + * @param descriptionForReviewers The description provided by the access review creator to be shown to + * reviewers. + * @return the next definition stage. + */ + Update withDescriptionForReviewers(String descriptionForReviewers); + } + /** The stage of the AccessReviewScheduleDefinition update allowing to specify reviewers. */ + interface WithReviewers { + /** + * Specifies the reviewers property: This is the collection of reviewers.. + * + * @param reviewers This is the collection of reviewers. + * @return the next definition stage. + */ + Update withReviewers(List reviewers); + } + /** The stage of the AccessReviewScheduleDefinition update allowing to specify backupReviewers. */ + interface WithBackupReviewers { + /** + * Specifies the backupReviewers property: This is the collection of backup reviewers.. + * + * @param backupReviewers This is the collection of backup reviewers. + * @return the next definition stage. + */ + Update withBackupReviewers(List backupReviewers); + } + /** The stage of the AccessReviewScheduleDefinition update allowing to specify instances. */ + interface WithInstances { + /** + * Specifies the instances property: This is the collection of instances returned when one does an expand on + * it.. + * + * @param instances This is the collection of instances returned when one does an expand on it. + * @return the next definition stage. + */ + Update withInstances(List instances); + } + /** The stage of the AccessReviewScheduleDefinition update allowing to specify mailNotificationsEnabled. */ + interface WithMailNotificationsEnabled { + /** + * Specifies the mailNotificationsEnabled property: Flag to indicate whether sending mails to reviewers and + * the review creator is enabled.. + * + * @param mailNotificationsEnabled Flag to indicate whether sending mails to reviewers and the review + * creator is enabled. + * @return the next definition stage. + */ + Update withMailNotificationsEnabled(Boolean mailNotificationsEnabled); + } + /** The stage of the AccessReviewScheduleDefinition update allowing to specify reminderNotificationsEnabled. */ + interface WithReminderNotificationsEnabled { + /** + * Specifies the reminderNotificationsEnabled property: Flag to indicate whether sending reminder emails to + * reviewers are enabled.. + * + * @param reminderNotificationsEnabled Flag to indicate whether sending reminder emails to reviewers are + * enabled. + * @return the next definition stage. + */ + Update withReminderNotificationsEnabled(Boolean reminderNotificationsEnabled); + } + /** The stage of the AccessReviewScheduleDefinition update allowing to specify defaultDecisionEnabled. */ + interface WithDefaultDecisionEnabled { + /** + * Specifies the defaultDecisionEnabled property: Flag to indicate whether reviewers are required to provide + * a justification when reviewing access.. + * + * @param defaultDecisionEnabled Flag to indicate whether reviewers are required to provide a justification + * when reviewing access. + * @return the next definition stage. + */ + Update withDefaultDecisionEnabled(Boolean defaultDecisionEnabled); + } + /** + * The stage of the AccessReviewScheduleDefinition update allowing to specify justificationRequiredOnApproval. + */ + interface WithJustificationRequiredOnApproval { + /** + * Specifies the justificationRequiredOnApproval property: Flag to indicate whether the reviewer is required + * to pass justification when recording a decision.. + * + * @param justificationRequiredOnApproval Flag to indicate whether the reviewer is required to pass + * justification when recording a decision. + * @return the next definition stage. + */ + Update withJustificationRequiredOnApproval(Boolean justificationRequiredOnApproval); + } + /** The stage of the AccessReviewScheduleDefinition update allowing to specify defaultDecision. */ + interface WithDefaultDecision { + /** + * Specifies the defaultDecision property: This specifies the behavior for the autoReview feature when an + * access review completes.. + * + * @param defaultDecision This specifies the behavior for the autoReview feature when an access review + * completes. + * @return the next definition stage. + */ + Update withDefaultDecision(DefaultDecisionType defaultDecision); + } + /** The stage of the AccessReviewScheduleDefinition update allowing to specify autoApplyDecisionsEnabled. */ + interface WithAutoApplyDecisionsEnabled { + /** + * Specifies the autoApplyDecisionsEnabled property: 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.. + * + * @param autoApplyDecisionsEnabled 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. + * @return the next definition stage. + */ + Update withAutoApplyDecisionsEnabled(Boolean autoApplyDecisionsEnabled); + } + /** The stage of the AccessReviewScheduleDefinition update allowing to specify recommendationsEnabled. */ + interface WithRecommendationsEnabled { + /** + * Specifies the recommendationsEnabled property: Flag to indicate whether showing recommendations to + * reviewers is enabled.. + * + * @param recommendationsEnabled Flag to indicate whether showing recommendations to reviewers is enabled. + * @return the next definition stage. + */ + Update withRecommendationsEnabled(Boolean recommendationsEnabled); + } + /** + * The stage of the AccessReviewScheduleDefinition update allowing to specify recommendationLookBackDuration. + */ + interface WithRecommendationLookBackDuration { + /** + * Specifies the recommendationLookBackDuration property: 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)). + * + * @param recommendationLookBackDuration 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)). + * @return the next definition stage. + */ + Update withRecommendationLookBackDuration(Duration recommendationLookBackDuration); + } + /** The stage of the AccessReviewScheduleDefinition update allowing to specify instanceDurationInDays. */ + interface WithInstanceDurationInDays { + /** + * Specifies the instanceDurationInDays property: The duration in days for an instance.. + * + * @param instanceDurationInDays The duration in days for an instance. + * @return the next definition stage. + */ + Update withInstanceDurationInDays(Integer instanceDurationInDays); + } + /** The stage of the AccessReviewScheduleDefinition update allowing to specify type. */ + interface WithType { + /** + * Specifies the type property: The recurrence type : weekly, monthly, etc.. + * + * @param type The recurrence type : weekly, monthly, etc. + * @return the next definition stage. + */ + Update withType(AccessReviewRecurrencePatternType type); + } + /** The stage of the AccessReviewScheduleDefinition update allowing to specify interval. */ + interface WithInterval { + /** + * Specifies the interval property: The interval for recurrence. For a quarterly review, the interval is 3 + * for type : absoluteMonthly.. + * + * @param interval The interval for recurrence. For a quarterly review, the interval is 3 for type : + * absoluteMonthly. + * @return the next definition stage. + */ + Update withInterval(Integer interval); + } + /** The stage of the AccessReviewScheduleDefinition update allowing to specify typeRangeType. */ + interface WithTypeRangeType { + /** + * Specifies the typeRangeType property: The recurrence range type. The possible values are: endDate, noEnd, + * numbered.. + * + * @param typeRangeType The recurrence range type. The possible values are: endDate, noEnd, numbered. + * @return the next definition stage. + */ + Update withTypeRangeType(AccessReviewRecurrenceRangeType typeRangeType); + } + /** The stage of the AccessReviewScheduleDefinition update allowing to specify numberOfOccurrences. */ + interface WithNumberOfOccurrences { + /** + * Specifies the numberOfOccurrences property: The number of times to repeat the access review. Required and + * must be positive if type is numbered.. + * + * @param numberOfOccurrences The number of times to repeat the access review. Required and must be positive + * if type is numbered. + * @return the next definition stage. + */ + Update withNumberOfOccurrences(Integer numberOfOccurrences); + } + /** The stage of the AccessReviewScheduleDefinition update allowing to specify startDate. */ + interface WithStartDate { + /** + * Specifies the startDate property: The DateTime when the review is scheduled to be start. This could be a + * date in the future. Required on create.. + * + * @param startDate The DateTime when the review is scheduled to be start. This could be a date in the + * future. Required on create. + * @return the next definition stage. + */ + Update withStartDate(OffsetDateTime startDate); + } + /** The stage of the AccessReviewScheduleDefinition update allowing to specify endDate. */ + interface WithEndDate { + /** + * Specifies the endDate property: The DateTime when the review is scheduled to end. Required if type is + * endDate. + * + * @param endDate The DateTime when the review is scheduled to end. Required if type is endDate. + * @return the next definition stage. + */ + Update withEndDate(OffsetDateTime endDate); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AccessReviewScheduleDefinition refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AccessReviewScheduleDefinition refresh(Context context); + + /** + * Stop access review definition. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(); + + /** + * Stop access review definition. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response stopWithResponse(Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewScheduleDefinitionListResult.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewScheduleDefinitionListResult.java new file mode 100644 index 0000000000000..8612bfb03c229 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewScheduleDefinitionListResult.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewScheduleDefinitionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Access Review Schedule Definitions. */ +@Fluent +public final class AccessReviewScheduleDefinitionListResult { + /* + * Access Review Schedule Definition list. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Access Review Schedule Definition list. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Access Review Schedule Definition list. + * + * @param value the value value to set. + * @return the AccessReviewScheduleDefinitionListResult object itself. + */ + public AccessReviewScheduleDefinitionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to use for getting the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to use for getting the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the AccessReviewScheduleDefinitionListResult object itself. + */ + public AccessReviewScheduleDefinitionListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewScheduleDefinitionReviewersType.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewScheduleDefinitionReviewersType.java new file mode 100644 index 0000000000000..deecffddeba0f --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewScheduleDefinitionReviewersType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * 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. + */ +public final class AccessReviewScheduleDefinitionReviewersType + extends ExpandableStringEnum { + /** Static value Assigned for AccessReviewScheduleDefinitionReviewersType. */ + public static final AccessReviewScheduleDefinitionReviewersType ASSIGNED = fromString("Assigned"); + + /** Static value Self for AccessReviewScheduleDefinitionReviewersType. */ + public static final AccessReviewScheduleDefinitionReviewersType SELF = fromString("Self"); + + /** Static value Managers for AccessReviewScheduleDefinitionReviewersType. */ + public static final AccessReviewScheduleDefinitionReviewersType MANAGERS = fromString("Managers"); + + /** + * Creates or finds a AccessReviewScheduleDefinitionReviewersType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccessReviewScheduleDefinitionReviewersType. + */ + @JsonCreator + public static AccessReviewScheduleDefinitionReviewersType fromString(String name) { + return fromString(name, AccessReviewScheduleDefinitionReviewersType.class); + } + + /** + * Gets known AccessReviewScheduleDefinitionReviewersType values. + * + * @return known AccessReviewScheduleDefinitionReviewersType values. + */ + public static Collection values() { + return values(AccessReviewScheduleDefinitionReviewersType.class); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewScheduleDefinitionStatus.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewScheduleDefinitionStatus.java new file mode 100644 index 0000000000000..0bc43616382d0 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewScheduleDefinitionStatus.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** This read-only field specifies the status of an accessReview. */ +public final class AccessReviewScheduleDefinitionStatus + extends ExpandableStringEnum { + /** Static value NotStarted for AccessReviewScheduleDefinitionStatus. */ + public static final AccessReviewScheduleDefinitionStatus NOT_STARTED = fromString("NotStarted"); + + /** Static value InProgress for AccessReviewScheduleDefinitionStatus. */ + public static final AccessReviewScheduleDefinitionStatus IN_PROGRESS = fromString("InProgress"); + + /** Static value Completed for AccessReviewScheduleDefinitionStatus. */ + public static final AccessReviewScheduleDefinitionStatus COMPLETED = fromString("Completed"); + + /** Static value Applied for AccessReviewScheduleDefinitionStatus. */ + public static final AccessReviewScheduleDefinitionStatus APPLIED = fromString("Applied"); + + /** Static value Initializing for AccessReviewScheduleDefinitionStatus. */ + public static final AccessReviewScheduleDefinitionStatus INITIALIZING = fromString("Initializing"); + + /** Static value Applying for AccessReviewScheduleDefinitionStatus. */ + public static final AccessReviewScheduleDefinitionStatus APPLYING = fromString("Applying"); + + /** Static value Completing for AccessReviewScheduleDefinitionStatus. */ + public static final AccessReviewScheduleDefinitionStatus COMPLETING = fromString("Completing"); + + /** Static value Scheduled for AccessReviewScheduleDefinitionStatus. */ + public static final AccessReviewScheduleDefinitionStatus SCHEDULED = fromString("Scheduled"); + + /** Static value AutoReviewing for AccessReviewScheduleDefinitionStatus. */ + public static final AccessReviewScheduleDefinitionStatus AUTO_REVIEWING = fromString("AutoReviewing"); + + /** Static value AutoReviewed for AccessReviewScheduleDefinitionStatus. */ + public static final AccessReviewScheduleDefinitionStatus AUTO_REVIEWED = fromString("AutoReviewed"); + + /** Static value Starting for AccessReviewScheduleDefinitionStatus. */ + public static final AccessReviewScheduleDefinitionStatus STARTING = fromString("Starting"); + + /** + * Creates or finds a AccessReviewScheduleDefinitionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccessReviewScheduleDefinitionStatus. + */ + @JsonCreator + public static AccessReviewScheduleDefinitionStatus fromString(String name) { + return fromString(name, AccessReviewScheduleDefinitionStatus.class); + } + + /** + * Gets known AccessReviewScheduleDefinitionStatus values. + * + * @return known AccessReviewScheduleDefinitionStatus values. + */ + public static Collection values() { + return values(AccessReviewScheduleDefinitionStatus.class); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewScheduleDefinitions.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewScheduleDefinitions.java new file mode 100644 index 0000000000000..6c429d33f9492 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewScheduleDefinitions.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of AccessReviewScheduleDefinitions. */ +public interface AccessReviewScheduleDefinitions { + /** + * Get access review schedule definitions. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review schedule definitions as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Get access review schedule definitions. + * + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review schedule definitions as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String filter, Context context); + + /** + * Get single access review definition. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single access review definition. + */ + AccessReviewScheduleDefinition getById(String scheduleDefinitionId); + + /** + * Get single access review definition. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single access review definition along with {@link Response}. + */ + Response getByIdWithResponse(String scheduleDefinitionId, Context context); + + /** + * Delete access review schedule definition. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String scheduleDefinitionId); + + /** + * Delete access review schedule definition. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String scheduleDefinitionId, Context context); + + /** + * Stop access review definition. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(String scheduleDefinitionId); + + /** + * Stop access review definition. + * + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response stopWithResponse(String scheduleDefinitionId, Context context); + + /** + * Begins definition for a new AccessReviewScheduleDefinition resource. + * + * @param name resource name. + * @return the first stage of the new AccessReviewScheduleDefinition definition. + */ + AccessReviewScheduleDefinition.DefinitionStages.Blank define(String name); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewScheduleDefinitionsAssignedForMyApprovals.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewScheduleDefinitionsAssignedForMyApprovals.java new file mode 100644 index 0000000000000..f79fe8ba36e39 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewScheduleDefinitionsAssignedForMyApprovals.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of AccessReviewScheduleDefinitionsAssignedForMyApprovals. */ +public interface AccessReviewScheduleDefinitionsAssignedForMyApprovals { + /** + * Get access review instances assigned for my approval. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances assigned for my approval as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Get access review instances assigned for my approval. + * + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances assigned for my approval as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String filter, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewScopeAssignmentState.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewScopeAssignmentState.java new file mode 100644 index 0000000000000..12495039281b8 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewScopeAssignmentState.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The role assignment state eligible/active to review. */ +public final class AccessReviewScopeAssignmentState extends ExpandableStringEnum { + /** Static value eligible for AccessReviewScopeAssignmentState. */ + public static final AccessReviewScopeAssignmentState ELIGIBLE = fromString("eligible"); + + /** Static value active for AccessReviewScopeAssignmentState. */ + public static final AccessReviewScopeAssignmentState ACTIVE = fromString("active"); + + /** + * Creates or finds a AccessReviewScopeAssignmentState from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccessReviewScopeAssignmentState. + */ + @JsonCreator + public static AccessReviewScopeAssignmentState fromString(String name) { + return fromString(name, AccessReviewScopeAssignmentState.class); + } + + /** + * Gets known AccessReviewScopeAssignmentState values. + * + * @return known AccessReviewScopeAssignmentState values. + */ + public static Collection values() { + return values(AccessReviewScopeAssignmentState.class); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewScopePrincipalType.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewScopePrincipalType.java new file mode 100644 index 0000000000000..2386d883350e8 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewScopePrincipalType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The identity type user/servicePrincipal to review. */ +public final class AccessReviewScopePrincipalType extends ExpandableStringEnum { + /** Static value user for AccessReviewScopePrincipalType. */ + public static final AccessReviewScopePrincipalType USER = fromString("user"); + + /** Static value guestUser for AccessReviewScopePrincipalType. */ + public static final AccessReviewScopePrincipalType GUEST_USER = fromString("guestUser"); + + /** Static value servicePrincipal for AccessReviewScopePrincipalType. */ + public static final AccessReviewScopePrincipalType SERVICE_PRINCIPAL = fromString("servicePrincipal"); + + /** Static value user,group for AccessReviewScopePrincipalType. */ + public static final AccessReviewScopePrincipalType USER_GROUP = fromString("user,group"); + + /** Static value redeemedGuestUser for AccessReviewScopePrincipalType. */ + public static final AccessReviewScopePrincipalType REDEEMED_GUEST_USER = fromString("redeemedGuestUser"); + + /** + * Creates or finds a AccessReviewScopePrincipalType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccessReviewScopePrincipalType. + */ + @JsonCreator + public static AccessReviewScopePrincipalType fromString(String name) { + return fromString(name, AccessReviewScopePrincipalType.class); + } + + /** + * Gets known AccessReviewScopePrincipalType values. + * + * @return known AccessReviewScopePrincipalType values. + */ + public static Collection values() { + return values(AccessReviewScopePrincipalType.class); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/DecisionResourceType.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/DecisionResourceType.java new file mode 100644 index 0000000000000..bda0eca2ac7b7 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/DecisionResourceType.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of resource. */ +public final class DecisionResourceType extends ExpandableStringEnum { + /** Static value azureRole for DecisionResourceType. */ + public static final DecisionResourceType AZURE_ROLE = fromString("azureRole"); + + /** + * Creates or finds a DecisionResourceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DecisionResourceType. + */ + @JsonCreator + public static DecisionResourceType fromString(String name) { + return fromString(name, DecisionResourceType.class); + } + + /** + * Gets known DecisionResourceType values. + * + * @return known DecisionResourceType values. + */ + public static Collection values() { + return values(DecisionResourceType.class); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/DecisionTargetType.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/DecisionTargetType.java new file mode 100644 index 0000000000000..db42f44d965de --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/DecisionTargetType.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of decision target : User/ServicePrincipal. */ +public final class DecisionTargetType extends ExpandableStringEnum { + /** Static value user for DecisionTargetType. */ + public static final DecisionTargetType USER = fromString("user"); + + /** Static value servicePrincipal for DecisionTargetType. */ + public static final DecisionTargetType SERVICE_PRINCIPAL = fromString("servicePrincipal"); + + /** + * Creates or finds a DecisionTargetType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DecisionTargetType. + */ + @JsonCreator + public static DecisionTargetType fromString(String name) { + return fromString(name, DecisionTargetType.class); + } + + /** + * Gets known DecisionTargetType values. + * + * @return known DecisionTargetType values. + */ + public static Collection values() { + return values(DecisionTargetType.class); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/DefaultDecisionType.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/DefaultDecisionType.java new file mode 100644 index 0000000000000..067d73ea547a5 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/DefaultDecisionType.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** This specifies the behavior for the autoReview feature when an access review completes. */ +public final class DefaultDecisionType extends ExpandableStringEnum { + /** Static value Approve for DefaultDecisionType. */ + public static final DefaultDecisionType APPROVE = fromString("Approve"); + + /** Static value Deny for DefaultDecisionType. */ + public static final DefaultDecisionType DENY = fromString("Deny"); + + /** Static value Recommendation for DefaultDecisionType. */ + public static final DefaultDecisionType RECOMMENDATION = fromString("Recommendation"); + + /** + * Creates or finds a DefaultDecisionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DefaultDecisionType. + */ + @JsonCreator + public static DefaultDecisionType fromString(String name) { + return fromString(name, DefaultDecisionType.class); + } + + /** + * Gets known DefaultDecisionType values. + * + * @return known DefaultDecisionType values. + */ + public static Collection values() { + return values(DefaultDecisionType.class); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/Operation.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/Operation.java new file mode 100644 index 0000000000000..a5eaf0409aa1c --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/Operation.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.resourcemanager.authorization.generated.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: Name of the operation. + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Indicates whether the operation is a data action. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Display of the operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: Origin of the operation. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the inner com.azure.resourcemanager.authorization.generated.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/OperationDisplay.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/OperationDisplay.java new file mode 100644 index 0000000000000..bed462d593c28 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/OperationDisplay.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The display information for a Microsoft.Authorization operation. */ +@Immutable +public final class OperationDisplay { + /* + * The resource provider name: Microsoft.Authorization. + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /* + * The resource on which the operation is performed. + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /* + * The operation that users can perform. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /* + * The description for the operation. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Get the provider property: The resource provider name: Microsoft.Authorization. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: The resource on which the operation is performed. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: The operation that users can perform. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: The description for the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/OperationListResult.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/OperationListResult.java new file mode 100644 index 0000000000000..fa806cd6c54a5 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/OperationListResult.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.authorization.generated.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of a request to list Microsoft.Authorization operations. */ +@Fluent +public final class OperationListResult { + /* + * The collection value. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI that can be used to request the next set of paged results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The collection value. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The collection value. + * + * @param value the value value to set. + * @return the OperationListResult object itself. + */ + public OperationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI that can be used to request the next set of paged results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI that can be used to request the next set of paged results. + * + * @param nextLink the nextLink value to set. + * @return the OperationListResult object itself. + */ + public OperationListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/Operations.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/Operations.java new file mode 100644 index 0000000000000..bdcff7eab6988 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/Operations.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Lists the operations available from this provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list Microsoft.Authorization operations as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists the operations available from this provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list Microsoft.Authorization operations as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RecordAllDecisionsProperties.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RecordAllDecisionsProperties.java new file mode 100644 index 0000000000000..09ba4c1ca9603 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RecordAllDecisionsProperties.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Record All Decisions payload. */ +@Fluent +public final class RecordAllDecisionsProperties { + /* + * The id of principal which needs to be approved/denied. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The id of resource which needs to be approved/denied. + */ + @JsonProperty(value = "resourceId", access = JsonProperty.Access.WRITE_ONLY) + private String resourceId; + + /* + * The decision to make. Approvers can take action of Approve/Deny + */ + @JsonProperty(value = "decision") + private RecordAllDecisionsResult decision; + + /* + * Justification provided by approvers for their action + */ + @JsonProperty(value = "justification") + private String justification; + + /** + * Get the principalId property: The id of principal which needs to be approved/denied. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the resourceId property: The id of resource which needs to be approved/denied. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Get the decision property: The decision to make. Approvers can take action of Approve/Deny. + * + * @return the decision value. + */ + public RecordAllDecisionsResult decision() { + return this.decision; + } + + /** + * Set the decision property: The decision to make. Approvers can take action of Approve/Deny. + * + * @param decision the decision value to set. + * @return the RecordAllDecisionsProperties object itself. + */ + public RecordAllDecisionsProperties withDecision(RecordAllDecisionsResult decision) { + this.decision = decision; + return this; + } + + /** + * Get the justification property: Justification provided by approvers for their action. + * + * @return the justification value. + */ + public String justification() { + return this.justification; + } + + /** + * Set the justification property: Justification provided by approvers for their action. + * + * @param justification the justification value to set. + * @return the RecordAllDecisionsProperties object itself. + */ + public RecordAllDecisionsProperties withJustification(String justification) { + this.justification = justification; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RecordAllDecisionsResult.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RecordAllDecisionsResult.java new file mode 100644 index 0000000000000..272f8d5cb72d1 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RecordAllDecisionsResult.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The decision to make. Approvers can take action of Approve/Deny. */ +public final class RecordAllDecisionsResult extends ExpandableStringEnum { + /** Static value Approve for RecordAllDecisionsResult. */ + public static final RecordAllDecisionsResult APPROVE = fromString("Approve"); + + /** Static value Deny for RecordAllDecisionsResult. */ + public static final RecordAllDecisionsResult DENY = fromString("Deny"); + + /** + * Creates or finds a RecordAllDecisionsResult from its string representation. + * + * @param name a name to look for. + * @return the corresponding RecordAllDecisionsResult. + */ + @JsonCreator + public static RecordAllDecisionsResult fromString(String name) { + return fromString(name, RecordAllDecisionsResult.class); + } + + /** + * Gets known RecordAllDecisionsResult values. + * + * @return known RecordAllDecisionsResult values. + */ + public static Collection values() { + return values(RecordAllDecisionsResult.class); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewDefaultSettings.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewDefaultSettings.java new file mode 100644 index 0000000000000..3cccc3e82a2b8 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewDefaultSettings.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewScheduleSettings; + +/** Resource collection API of ScopeAccessReviewDefaultSettings. */ +public interface ScopeAccessReviewDefaultSettings { + /** + * Get access review default settings for the subscription. + * + * @param scope The scope of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review default settings for the subscription. + */ + AccessReviewDefaultSettings get(String scope); + + /** + * Get access review default settings for the subscription. + * + * @param scope The scope of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review default settings for the subscription along with {@link Response}. + */ + Response getWithResponse(String scope, Context context); + + /** + * Get access review default settings for the subscription. + * + * @param scope The scope of the resource. + * @param properties Access review schedule settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review default settings for the subscription. + */ + AccessReviewDefaultSettings put(String scope, AccessReviewScheduleSettings properties); + + /** + * Get access review default settings for the subscription. + * + * @param scope The scope of the resource. + * @param properties Access review schedule settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review default settings for the subscription along with {@link Response}. + */ + Response putWithResponse( + String scope, AccessReviewScheduleSettings properties, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewHistoryDefinitionInstances.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewHistoryDefinitionInstances.java new file mode 100644 index 0000000000000..449cd15bb83ee --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewHistoryDefinitionInstances.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ScopeAccessReviewHistoryDefinitionInstances. */ +public interface ScopeAccessReviewHistoryDefinitionInstances { + /** + * 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 scope The scope of the resource. + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review History Definition Instance. + */ + AccessReviewHistoryInstance generateDownloadUri(String scope, String historyDefinitionId, String instanceId); + + /** + * 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 scope The scope of the resource. + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review History Definition Instance along with {@link Response}. + */ + Response generateDownloadUriWithResponse( + String scope, String historyDefinitionId, String instanceId, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewHistoryDefinitionInstancesOperations.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewHistoryDefinitionInstancesOperations.java new file mode 100644 index 0000000000000..e9c9774298966 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewHistoryDefinitionInstancesOperations.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of ScopeAccessReviewHistoryDefinitionInstancesOperations. */ +public interface ScopeAccessReviewHistoryDefinitionInstancesOperations { + /** + * Get access review history definition instances by definition Id. + * + * @param scope The scope of the resource. + * @param historyDefinitionId The id of the access review history definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review history definition instances by definition Id as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String scope, String historyDefinitionId); + + /** + * Get access review history definition instances by definition Id. + * + * @param scope The scope of the resource. + * @param historyDefinitionId The id of the access review history definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review history definition instances by definition Id as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String scope, String historyDefinitionId, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewHistoryDefinitionOperations.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewHistoryDefinitionOperations.java new file mode 100644 index 0000000000000..47dded26c61f1 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewHistoryDefinitionOperations.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryDefinitionProperties; + +/** Resource collection API of ScopeAccessReviewHistoryDefinitionOperations. */ +public interface ScopeAccessReviewHistoryDefinitionOperations { + /** + * Create a scheduled or one-time Access Review History Definition. + * + * @param scope The scope of the resource. + * @param historyDefinitionId The id of the access review history definition. + * @param properties Access review history definition properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review History Definition. + */ + AccessReviewHistoryDefinition create( + String scope, String historyDefinitionId, AccessReviewHistoryDefinitionProperties properties); + + /** + * Create a scheduled or one-time Access Review History Definition. + * + * @param scope The scope of the resource. + * @param historyDefinitionId The id of the access review history definition. + * @param properties Access review history definition properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review History Definition along with {@link Response}. + */ + Response createWithResponse( + String scope, String historyDefinitionId, AccessReviewHistoryDefinitionProperties properties, Context context); + + /** + * Delete an access review history definition. + * + * @param scope The scope of the resource. + * @param historyDefinitionId The id of the access review history definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String scope, String historyDefinitionId); + + /** + * Delete an access review history definition. + * + * @param scope The scope of the resource. + * @param historyDefinitionId The id of the access review history definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String scope, String historyDefinitionId, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewHistoryDefinitions.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewHistoryDefinitions.java new file mode 100644 index 0000000000000..ece002c8ead09 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewHistoryDefinitions.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ScopeAccessReviewHistoryDefinitions. */ +public interface ScopeAccessReviewHistoryDefinitions { + /** + * Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available + * for 30 days after creation. + * + * @param scope The scope of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review History Definitions as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String scope); + + /** + * Lists the accessReviewHistoryDefinitions available from this provider, definition instances are only available + * for 30 days after creation. + * + * @param scope The scope of the resource. + * @param filter The filter to apply on the operation. Only standard filters on definition name and created date are + * supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Access Review History Definitions as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String scope, String filter, Context context); + + /** + * Get access review history definition by definition Id. + * + * @param scope The scope of the resource. + * @param historyDefinitionId The id of the access review history definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review history definition by definition Id. + */ + AccessReviewHistoryDefinition getById(String scope, String historyDefinitionId); + + /** + * Get access review history definition by definition Id. + * + * @param scope The scope of the resource. + * @param historyDefinitionId The id of the access review history definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review history definition by definition Id along with {@link Response}. + */ + Response getByIdWithResponse( + String scope, String historyDefinitionId, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewInstanceContactedReviewers.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewInstanceContactedReviewers.java new file mode 100644 index 0000000000000..0df5cb177a534 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewInstanceContactedReviewers.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of ScopeAccessReviewInstanceContactedReviewers. */ +public interface ScopeAccessReviewInstanceContactedReviewers { + /** + * Get access review instance contacted reviewers. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance contacted reviewers as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String scope, String scheduleDefinitionId, String id); + + /** + * Get access review instance contacted reviewers. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance contacted reviewers as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String scope, String scheduleDefinitionId, String id, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewInstanceDecisions.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewInstanceDecisions.java new file mode 100644 index 0000000000000..60dce76a0fef6 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewInstanceDecisions.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of ScopeAccessReviewInstanceDecisions. */ +public interface ScopeAccessReviewInstanceDecisions { + /** + * Get access review instance decisions. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance decisions as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String scope, String scheduleDefinitionId, String id); + + /** + * Get access review instance decisions. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance decisions as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String scope, String scheduleDefinitionId, String id, String filter, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewInstanceOperations.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewInstanceOperations.java new file mode 100644 index 0000000000000..eb1d618d098a9 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewInstanceOperations.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ScopeAccessReviewInstanceOperations. */ +public interface ScopeAccessReviewInstanceOperations { + /** + * An action to stop an access review instance. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(String scope, String scheduleDefinitionId, String id); + + /** + * An action to stop an access review instance. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response stopWithResponse(String scope, String scheduleDefinitionId, String id, Context context); + + /** + * An action to approve/deny all decisions for a review with certain filters. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param properties Record all decisions payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void recordAllDecisions( + String scope, String scheduleDefinitionId, String id, RecordAllDecisionsProperties properties); + + /** + * An action to approve/deny all decisions for a review with certain filters. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param properties Record all decisions payload. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response recordAllDecisionsWithResponse( + String scope, String scheduleDefinitionId, String id, RecordAllDecisionsProperties properties, Context context); + + /** + * An action to reset all decisions for an access review instance. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void resetDecisions(String scope, String scheduleDefinitionId, String id); + + /** + * An action to reset all decisions for an access review instance. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response resetDecisionsWithResponse(String scope, String scheduleDefinitionId, String id, Context context); + + /** + * An action to apply all decisions for an access review instance. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void applyDecisions(String scope, String scheduleDefinitionId, String id); + + /** + * An action to apply all decisions for an access review instance. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response applyDecisionsWithResponse(String scope, String scheduleDefinitionId, String id, Context context); + + /** + * An action to send reminders for an access review instance. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void sendReminders(String scope, String scheduleDefinitionId, String id); + + /** + * An action to send reminders for an access review instance. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response sendRemindersWithResponse(String scope, String scheduleDefinitionId, String id, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewInstances.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewInstances.java new file mode 100644 index 0000000000000..b897c4b511b0d --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewInstances.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewInstanceProperties; + +/** Resource collection API of ScopeAccessReviewInstances. */ +public interface ScopeAccessReviewInstances { + /** + * Get access review instances. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String scope, String scheduleDefinitionId); + + /** + * Get access review instances. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String scope, String scheduleDefinitionId, String filter, Context context); + + /** + * Get access review instances. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances. + */ + AccessReviewInstance getById(String scope, String scheduleDefinitionId, String id); + + /** + * Get access review instances. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param id The id of the access review instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instances along with {@link Response}. + */ + Response getByIdWithResponse( + String scope, String scheduleDefinitionId, String id, Context context); + + /** + * Update access review instance. + * + * @param scope The scope of the resource. + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review Instance. + */ + AccessReviewInstance create( + String scope, String scheduleDefinitionId, String id, AccessReviewInstanceProperties properties); + + /** + * Update access review instance. + * + * @param scope The scope of the resource. + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review Instance along with {@link Response}. + */ + Response createWithResponse( + String scope, + String scheduleDefinitionId, + String id, + AccessReviewInstanceProperties properties, + Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewScheduleDefinitions.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewScheduleDefinitions.java new file mode 100644 index 0000000000000..50ae7886284bf --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ScopeAccessReviewScheduleDefinitions.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewScheduleDefinitionProperties; + +/** Resource collection API of ScopeAccessReviewScheduleDefinitions. */ +public interface ScopeAccessReviewScheduleDefinitions { + /** + * Get access review schedule definitions. + * + * @param scope The scope of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review schedule definitions as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String scope); + + /** + * Get access review schedule definitions. + * + * @param scope The scope of the resource. + * @param filter The filter to apply on the operation. Other than standard filters, one custom filter option is + * supported : 'assignedToMeToReview()'. When one specified $filter=assignedToMeToReview(), only items that are + * assigned to the calling user to review are returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review schedule definitions as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String scope, String filter, Context context); + + /** + * Get single access review definition. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single access review definition. + */ + AccessReviewScheduleDefinition getById(String scope, String scheduleDefinitionId); + + /** + * Get single access review definition. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return single access review definition along with {@link Response}. + */ + Response getByIdWithResponse( + String scope, String scheduleDefinitionId, Context context); + + /** + * Delete access review schedule definition. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String scope, String scheduleDefinitionId); + + /** + * Delete access review schedule definition. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String scope, String scheduleDefinitionId, Context context); + + /** + * Create or Update access review schedule definition. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param properties Access review schedule definition properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review Schedule Definition. + */ + AccessReviewScheduleDefinition createOrUpdateById( + String scope, String scheduleDefinitionId, AccessReviewScheduleDefinitionProperties properties); + + /** + * Create or Update access review schedule definition. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param properties Access review schedule definition properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access Review Schedule Definition along with {@link Response}. + */ + Response createOrUpdateByIdWithResponse( + String scope, + String scheduleDefinitionId, + AccessReviewScheduleDefinitionProperties properties, + Context context); + + /** + * Stop access review definition. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(String scope, String scheduleDefinitionId); + + /** + * Stop access review definition. + * + * @param scope The scope of the resource. + * @param scheduleDefinitionId The id of the access review schedule definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response stopWithResponse(String scope, String scheduleDefinitionId, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/TenantLevelAccessReviewInstanceContactedReviewers.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/TenantLevelAccessReviewInstanceContactedReviewers.java new file mode 100644 index 0000000000000..c019d66b6a6f4 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/TenantLevelAccessReviewInstanceContactedReviewers.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of TenantLevelAccessReviewInstanceContactedReviewers. */ +public 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance contacted reviewers as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String scheduleDefinitionId, String id); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return access review instance contacted reviewers as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String scheduleDefinitionId, String id, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/package-info.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/package-info.java new file mode 100644 index 0000000000000..a17b72025cbf1 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the data models for AuthorizationManagementClient. Access reviews service provides the workflow + * for running access reviews on different kind of resources. + */ +package com.azure.resourcemanager.authorization.generated.models; diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/package-info.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/package-info.java new file mode 100644 index 0000000000000..156190451efbe --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the classes for AuthorizationManagementClient. Access reviews service provides the workflow for + * running access reviews on different kind of resources. + */ +package com.azure.resourcemanager.authorization.generated; diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/module-info.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/module-info.java new file mode 100644 index 0000000000000..ff6e8e09354da --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.authorization.generated { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.authorization.generated; + exports com.azure.resourcemanager.authorization.generated.fluent; + exports com.azure.resourcemanager.authorization.generated.fluent.models; + exports com.azure.resourcemanager.authorization.generated.models; + + opens com.azure.resourcemanager.authorization.generated.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.authorization.generated.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AccessReviewInstanceMyDecisionsGetByIdSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AccessReviewInstanceMyDecisionsGetByIdSamples.java new file mode 100644 index 0000000000000..39f577e0f1ff1 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AccessReviewInstanceMyDecisionsGetByIdSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for AccessReviewInstanceMyDecisions GetById. */ +public final class AccessReviewInstanceMyDecisionsGetByIdSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/GetAccessReviewInstanceMyDecisionById.json + */ + /** + * Sample code: GetAccessReviews. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReviews( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .accessReviewInstanceMyDecisions() + .getByIdWithResponse( + "488a6d0e-0a63-4946-86e3-1f5bbc934661", + "4135f961-be78-4005-8101-c72a5af307a2", + "fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AccessReviewInstanceMyDecisionsListSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AccessReviewInstanceMyDecisionsListSamples.java new file mode 100644 index 0000000000000..b631a156a24d0 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AccessReviewInstanceMyDecisionsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for AccessReviewInstanceMyDecisions List. */ +public final class AccessReviewInstanceMyDecisionsListSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/GetAccessReviewInstanceMyDecisions.json + */ + /** + * Sample code: GetAccessReviews. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReviews( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .accessReviewInstanceMyDecisions() + .list("488a6d0e-0a63-4946-86e3-1f5bbc934661", "4135f961-be78-4005-8101-c72a5af307a2", null, Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AccessReviewInstanceMyDecisionsPatchSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AccessReviewInstanceMyDecisionsPatchSamples.java new file mode 100644 index 0000000000000..a920d926e7d87 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AccessReviewInstanceMyDecisionsPatchSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewDecisionProperties; + +/** Samples for AccessReviewInstanceMyDecisions Patch. */ +public final class AccessReviewInstanceMyDecisionsPatchSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/PatchAccessReviewInstanceMyDecisionById.json + */ + /** + * Sample code: GetAccessReviews. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReviews( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .accessReviewInstanceMyDecisions() + .patchWithResponse( + "488a6d0e-0a63-4946-86e3-1f5bbc934661", + "4135f961-be78-4005-8101-c72a5af307a2", + "fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + new AccessReviewDecisionProperties(), + Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AccessReviewInstanceOperationAcceptRecommendationsSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AccessReviewInstanceOperationAcceptRecommendationsSamples.java new file mode 100644 index 0000000000000..821384513b2f7 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AccessReviewInstanceOperationAcceptRecommendationsSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for AccessReviewInstanceOperation AcceptRecommendations. */ +public final class AccessReviewInstanceOperationAcceptRecommendationsSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/AccessReviewInstanceAcceptRecommendations.json + */ + /** + * Sample code: GetAccessReview. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReview(com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .accessReviewInstanceOperations() + .acceptRecommendationsWithResponse( + "488a6d0e-0a63-4946-86e3-1f5bbc934661", "d9b9e056-7004-470b-bf21-1635e98487da", Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AccessReviewInstancesAssignedForMyApprovalGetByIdSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AccessReviewInstancesAssignedForMyApprovalGetByIdSamples.java new file mode 100644 index 0000000000000..12a886ed32148 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AccessReviewInstancesAssignedForMyApprovalGetByIdSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for AccessReviewInstancesAssignedForMyApproval GetById. */ +public final class AccessReviewInstancesAssignedForMyApprovalGetByIdSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/GetAccessReviewInstanceAssignedForMyApproval.json + */ + /** + * Sample code: GetAccessReviews. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReviews( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .accessReviewInstancesAssignedForMyApprovals() + .getByIdWithResponse( + "488a6d0e-0a63-4946-86e3-1f5bbc934661", "4135f961-be78-4005-8101-c72a5af307a2", Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AccessReviewInstancesAssignedForMyApprovalListSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AccessReviewInstancesAssignedForMyApprovalListSamples.java new file mode 100644 index 0000000000000..fab26bffc5166 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AccessReviewInstancesAssignedForMyApprovalListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for AccessReviewInstancesAssignedForMyApproval List. */ +public final class AccessReviewInstancesAssignedForMyApprovalListSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/GetAccessReviewInstancesAssignedForMyApproval.json + */ + /** + * Sample code: GetAccessReviews. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReviews( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .accessReviewInstancesAssignedForMyApprovals() + .list("488a6d0e-0a63-4946-86e3-1f5bbc934661", "assignedToMeToReview()", Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AccessReviewScheduleDefinitionsAssignedForMyApprovalListSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AccessReviewScheduleDefinitionsAssignedForMyApprovalListSamples.java new file mode 100644 index 0000000000000..612966da89df6 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AccessReviewScheduleDefinitionsAssignedForMyApprovalListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for AccessReviewScheduleDefinitionsAssignedForMyApproval List. */ +public final class AccessReviewScheduleDefinitionsAssignedForMyApprovalListSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/GetAccessReviewScheduleDefinitionsAssignedForMyApproval.json + */ + /** + * Sample code: GetAccessReviews. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReviews( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager.accessReviewScheduleDefinitionsAssignedForMyApprovals().list("assignedToMeToReview()", Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewDefaultSettingsGetSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewDefaultSettingsGetSamples.java new file mode 100644 index 0000000000000..482802fa871ac --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewDefaultSettingsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ScopeAccessReviewDefaultSettings Get. */ +public final class ScopeAccessReviewDefaultSettingsGetSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/GetAccessReviewDefaultSettings.json + */ + /** + * Sample code: GetAccessReviewDefaultSettings. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReviewDefaultSettings( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewDefaultSettings() + .getWithResponse("subscriptions/fa73e90b-5bf1-45fd-a182-35ce5fc0674d", Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewDefaultSettingsPutSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewDefaultSettingsPutSamples.java new file mode 100644 index 0000000000000..bbd8dcbf4e832 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewDefaultSettingsPutSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewScheduleSettings; + +/** Samples for ScopeAccessReviewDefaultSettings Put. */ +public final class ScopeAccessReviewDefaultSettingsPutSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/PutAccessReviewDefaultSettings.json + */ + /** + * Sample code: GetAccessReviewDefaultSettings. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReviewDefaultSettings( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewDefaultSettings() + .putWithResponse( + "subscriptions/fa73e90b-5bf1-45fd-a182-35ce5fc0674d", new AccessReviewScheduleSettings(), Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewHistoryDefinitionInstanceGenerateDownloadUriSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewHistoryDefinitionInstanceGenerateDownloadUriSamples.java new file mode 100644 index 0000000000000..a0580bba33d28 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewHistoryDefinitionInstanceGenerateDownloadUriSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ScopeAccessReviewHistoryDefinitionInstance GenerateDownloadUri. */ +public final class ScopeAccessReviewHistoryDefinitionInstanceGenerateDownloadUriSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/PostAccessReviewHistoryDefinitionInstance.json + */ + /** + * Sample code: PostAccessReviewHistoryDefinitionInstance. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void postAccessReviewHistoryDefinitionInstance( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewHistoryDefinitionInstances() + .generateDownloadUriWithResponse( + "subscriptions/129a304b-4aea-4b86-a9f7-ba7e2b23737a", + "44724910-d7a5-4c29-b28f-db73e717165a", + "9038f4f3-3d8d-43c3-8ede-669ea082c43b", + Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewHistoryDefinitionInstancesOperationListSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewHistoryDefinitionInstancesOperationListSamples.java new file mode 100644 index 0000000000000..af36dbab1a185 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewHistoryDefinitionInstancesOperationListSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ScopeAccessReviewHistoryDefinitionInstancesOperation List. */ +public final class ScopeAccessReviewHistoryDefinitionInstancesOperationListSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/GetAccessReviewHistoryDefinitionInstances.json + */ + /** + * Sample code: GetAccessReviewHistoryDefinitionInstances. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReviewHistoryDefinitionInstances( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewHistoryDefinitionInstancesOperations() + .list( + "subscriptions/129a304b-4aea-4b86-a9f7-ba7e2b23737a", + "44724910-d7a5-4c29-b28f-db73e717165a", + Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewHistoryDefinitionOperationCreateSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewHistoryDefinitionOperationCreateSamples.java new file mode 100644 index 0000000000000..708d787a4acc1 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewHistoryDefinitionOperationCreateSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewHistoryDefinitionProperties; + +/** Samples for ScopeAccessReviewHistoryDefinitionOperation Create. */ +public final class ScopeAccessReviewHistoryDefinitionOperationCreateSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/PutAccessReviewHistoryDefinition.json + */ + /** + * Sample code: PutAccessReviewHistoryDefinition. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void putAccessReviewHistoryDefinition( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewHistoryDefinitionOperations() + .createWithResponse( + "subscriptions/129a304b-4aea-4b86-a9f7-ba7e2b23737a", + "44724910-d7a5-4c29-b28f-db73e717165a", + new AccessReviewHistoryDefinitionProperties(), + Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewHistoryDefinitionOperationDeleteByIdSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewHistoryDefinitionOperationDeleteByIdSamples.java new file mode 100644 index 0000000000000..f3754f34118a1 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewHistoryDefinitionOperationDeleteByIdSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ScopeAccessReviewHistoryDefinitionOperation DeleteById. */ +public final class ScopeAccessReviewHistoryDefinitionOperationDeleteByIdSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/DeleteAccessReviewHistoryDefinition.json + */ + /** + * Sample code: DeleteAccessReview. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void deleteAccessReview( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewHistoryDefinitionOperations() + .deleteByIdWithResponse( + "subscriptions/fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewHistoryDefinitionsGetByIdSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewHistoryDefinitionsGetByIdSamples.java new file mode 100644 index 0000000000000..3296c985ae641 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewHistoryDefinitionsGetByIdSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ScopeAccessReviewHistoryDefinitions GetById. */ +public final class ScopeAccessReviewHistoryDefinitionsGetByIdSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/GetAccessReviewHistoryDefinition.json + */ + /** + * Sample code: GetAccessReviewHistoryDefinition. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReviewHistoryDefinition( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewHistoryDefinitions() + .getByIdWithResponse( + "subscriptions/129a304b-4aea-4b86-a9f7-ba7e2b23737a", + "44724910-d7a5-4c29-b28f-db73e717165a", + Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewHistoryDefinitionsListSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewHistoryDefinitionsListSamples.java new file mode 100644 index 0000000000000..0ae60266dce57 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewHistoryDefinitionsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ScopeAccessReviewHistoryDefinitions List. */ +public final class ScopeAccessReviewHistoryDefinitionsListSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/GetAccessReviewHistoryDefinitions.json + */ + /** + * Sample code: GetAccessReviewHistoryDefinitions. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReviewHistoryDefinitions( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewHistoryDefinitions() + .list("subscriptions/129a304b-4aea-4b86-a9f7-ba7e2b23737a", null, Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstanceContactedReviewersListSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstanceContactedReviewersListSamples.java new file mode 100644 index 0000000000000..178ddd5885e41 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstanceContactedReviewersListSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ScopeAccessReviewInstanceContactedReviewers List. */ +public final class ScopeAccessReviewInstanceContactedReviewersListSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/GetAccessReviewInstanceContactedReviewers.json + */ + /** + * Sample code: GetAccessReviews. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReviews( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewInstanceContactedReviewers() + .list( + "subscriptions/fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "265785a7-a81f-4201-8a18-bb0db95982b7", + "f25ed880-9c31-4101-bc57-825d8df3b58c", + Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstanceDecisionsListSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstanceDecisionsListSamples.java new file mode 100644 index 0000000000000..2207ec57cf036 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstanceDecisionsListSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ScopeAccessReviewInstanceDecisions List. */ +public final class ScopeAccessReviewInstanceDecisionsListSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/GetAccessReviewInstanceDecisions.json + */ + /** + * Sample code: GetAccessReviews. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReviews( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewInstanceDecisions() + .list( + "subscriptions/fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "265785a7-a81f-4201-8a18-bb0db95982b7", + "f25ed880-9c31-4101-bc57-825d8df3b58c", + null, + Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstanceOperationApplyDecisionsSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstanceOperationApplyDecisionsSamples.java new file mode 100644 index 0000000000000..0d7a3571521e2 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstanceOperationApplyDecisionsSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ScopeAccessReviewInstanceOperation ApplyDecisions. */ +public final class ScopeAccessReviewInstanceOperationApplyDecisionsSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/AccessReviewInstanceApplyDecisions.json + */ + /** + * Sample code: GetAccessReview. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReview(com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewInstanceOperations() + .applyDecisionsWithResponse( + "subscriptions/fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "d9b9e056-7004-470b-bf21-1635e98487da", + Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstanceOperationRecordAllDecisionsSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstanceOperationRecordAllDecisionsSamples.java new file mode 100644 index 0000000000000..83bdafd77adc9 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstanceOperationRecordAllDecisionsSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.models.RecordAllDecisionsProperties; + +/** Samples for ScopeAccessReviewInstanceOperation RecordAllDecisions. */ +public final class ScopeAccessReviewInstanceOperationRecordAllDecisionsSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/AccessReviewInstanceRecordAllDecisions.json + */ + /** + * Sample code: AccessReviewInstanceRecordAllDecisions. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void accessReviewInstanceRecordAllDecisions( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewInstanceOperations() + .recordAllDecisionsWithResponse( + "subscriptions/fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "d9b9e056-7004-470b-bf21-1635e98487da", + new RecordAllDecisionsProperties(), + Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstanceOperationResetDecisionsSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstanceOperationResetDecisionsSamples.java new file mode 100644 index 0000000000000..d53f4740e4128 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstanceOperationResetDecisionsSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ScopeAccessReviewInstanceOperation ResetDecisions. */ +public final class ScopeAccessReviewInstanceOperationResetDecisionsSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/AccessReviewInstanceResetDecisions.json + */ + /** + * Sample code: GetAccessReview. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReview(com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewInstanceOperations() + .resetDecisionsWithResponse( + "subscriptions/fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "d9b9e056-7004-470b-bf21-1635e98487da", + Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstanceOperationSendRemindersSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstanceOperationSendRemindersSamples.java new file mode 100644 index 0000000000000..6571c704ce604 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstanceOperationSendRemindersSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ScopeAccessReviewInstanceOperation SendReminders. */ +public final class ScopeAccessReviewInstanceOperationSendRemindersSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/AccessReviewInstanceSendReminders.json + */ + /** + * Sample code: GetAccessReview. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReview(com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewInstanceOperations() + .sendRemindersWithResponse( + "subscriptions/fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "d9b9e056-7004-470b-bf21-1635e98487da", + Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstanceOperationStopSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstanceOperationStopSamples.java new file mode 100644 index 0000000000000..673c32e098eb2 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstanceOperationStopSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ScopeAccessReviewInstanceOperation Stop. */ +public final class ScopeAccessReviewInstanceOperationStopSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/StopAccessReviewInstance.json + */ + /** + * Sample code: GetAccessReview. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReview(com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewInstanceOperations() + .stopWithResponse( + "subscriptions/fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "d9b9e056-7004-470b-bf21-1635e98487da", + Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstancesCreateSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstancesCreateSamples.java new file mode 100644 index 0000000000000..95bcdf2951e77 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstancesCreateSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewInstanceProperties; + +/** Samples for ScopeAccessReviewInstances Create. */ +public final class ScopeAccessReviewInstancesCreateSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/PutAccessReviewInstance.json + */ + /** + * Sample code: GetAccessReviews. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReviews( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewInstances() + .createWithResponse( + "subscriptions/fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "4135f961-be78-4005-8101-c72a5af307a2", + new AccessReviewInstanceProperties(), + Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstancesGetByIdSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstancesGetByIdSamples.java new file mode 100644 index 0000000000000..881cf14436819 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstancesGetByIdSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ScopeAccessReviewInstances GetById. */ +public final class ScopeAccessReviewInstancesGetByIdSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/GetAccessReviewInstance.json + */ + /** + * Sample code: GetAccessReviews. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReviews( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewInstances() + .getByIdWithResponse( + "subscriptions/fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "4135f961-be78-4005-8101-c72a5af307a2", + Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstancesListSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstancesListSamples.java new file mode 100644 index 0000000000000..d93e385d9defc --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstancesListSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ScopeAccessReviewInstances List. */ +public final class ScopeAccessReviewInstancesListSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/GetAccessReviewInstances.json + */ + /** + * Sample code: GetAccessReviews. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReviews( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewInstances() + .list( + "subscriptions/fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "265785a7-a81f-4201-8a18-bb0db95982b7", + null, + Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewScheduleDefinitionsCreateOrUpdateByIdSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewScheduleDefinitionsCreateOrUpdateByIdSamples.java new file mode 100644 index 0000000000000..adb1b6634c786 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewScheduleDefinitionsCreateOrUpdateByIdSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.AccessReviewScheduleDefinitionProperties; + +/** Samples for ScopeAccessReviewScheduleDefinitions CreateOrUpdateById. */ +public final class ScopeAccessReviewScheduleDefinitionsCreateOrUpdateByIdSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/PutAccessReviewScheduleDefinition.json + */ + /** + * Sample code: PutAccessReview. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void putAccessReview(com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewScheduleDefinitions() + .createOrUpdateByIdWithResponse( + "subscriptions/fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + new AccessReviewScheduleDefinitionProperties(), + Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewScheduleDefinitionsDeleteByIdSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewScheduleDefinitionsDeleteByIdSamples.java new file mode 100644 index 0000000000000..0e3095ac448ad --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewScheduleDefinitionsDeleteByIdSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ScopeAccessReviewScheduleDefinitions DeleteById. */ +public final class ScopeAccessReviewScheduleDefinitionsDeleteByIdSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/DeleteAccessReviewScheduleDefinition.json + */ + /** + * Sample code: DeleteAccessReview. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void deleteAccessReview( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewScheduleDefinitions() + .deleteByIdWithResponse( + "subscriptions/fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewScheduleDefinitionsGetByIdSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewScheduleDefinitionsGetByIdSamples.java new file mode 100644 index 0000000000000..a591ee7da7c63 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewScheduleDefinitionsGetByIdSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ScopeAccessReviewScheduleDefinitions GetById. */ +public final class ScopeAccessReviewScheduleDefinitionsGetByIdSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/GetAccessReviewScheduleDefinition.json + */ + /** + * Sample code: GetAccessReview. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReview(com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewScheduleDefinitions() + .getByIdWithResponse( + "subscriptions/fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewScheduleDefinitionsListSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewScheduleDefinitionsListSamples.java new file mode 100644 index 0000000000000..ef6b15cdbbf53 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewScheduleDefinitionsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ScopeAccessReviewScheduleDefinitions List. */ +public final class ScopeAccessReviewScheduleDefinitionsListSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/GetAccessReviewScheduleDefinitions.json + */ + /** + * Sample code: GetAccessReviews. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReviews( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewScheduleDefinitions() + .list("subscriptions/fa73e90b-5bf1-45fd-a182-35ce5fc0674d", null, Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewScheduleDefinitionsStopSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewScheduleDefinitionsStopSamples.java new file mode 100644 index 0000000000000..42df33a2726de --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewScheduleDefinitionsStopSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ScopeAccessReviewScheduleDefinitions Stop. */ +public final class ScopeAccessReviewScheduleDefinitionsStopSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/StopAccessReviewScheduleDefinition.json + */ + /** + * Sample code: GetAccessReview. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReview(com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .scopeAccessReviewScheduleDefinitions() + .stopWithResponse( + "subscriptions/fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + "fa73e90b-5bf1-45fd-a182-35ce5fc0674d", + Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/TenantLevelAccessReviewInstanceContactedReviewersListSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/TenantLevelAccessReviewInstanceContactedReviewersListSamples.java new file mode 100644 index 0000000000000..6175b7da22a96 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/TenantLevelAccessReviewInstanceContactedReviewersListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.authorization.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for TenantLevelAccessReviewInstanceContactedReviewers List. */ +public final class TenantLevelAccessReviewInstanceContactedReviewersListSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2021-12-01-preview/examples/TenantLevelGetAccessReviewInstanceContactedReviewers.json + */ + /** + * Sample code: GetAccessReviews. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAccessReviews( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .tenantLevelAccessReviewInstanceContactedReviewers() + .list("265785a7-a81f-4201-8a18-bb0db95982b7", "f25ed880-9c31-4101-bc57-825d8df3b58c", Context.NONE); + } +} diff --git a/sdk/authorization/ci.yml b/sdk/authorization/ci.yml new file mode 100644 index 0000000000000..eb62b2724b500 --- /dev/null +++ b/sdk/authorization/ci.yml @@ -0,0 +1,47 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/authorization/ci.yml + - sdk/authorization/azure-resourcemanager-authorization-generated/ + exclude: + - sdk/authorization/pom.xml + - sdk/authorization/azure-resourcemanager-authorization-generated/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/authorization/ci.yml + - sdk/authorization/azure-resourcemanager-authorization-generated/ + exclude: + - sdk/authorization/pom.xml + - sdk/authorization/azure-resourcemanager-authorization-generated/pom.xml + +parameters: + - name: release_azureresourcemanagerauthorizationgenerated + displayName: azure-resourcemanager-authorization-generated + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: authorization + EnableBatchRelease: true + Artifacts: + - name: azure-resourcemanager-authorization-generated + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerauthorizationgenerated + releaseInBatch: ${{ parameters.release_azureresourcemanagerauthorizationgenerated }} diff --git a/sdk/authorization/pom.xml b/sdk/authorization/pom.xml new file mode 100644 index 0000000000000..ac027b696debd --- /dev/null +++ b/sdk/authorization/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-authorization-service + pom + 1.0.0 + + + azure-resourcemanager-authorization-generated + +