From e3e07c44ccc19846b3d5df1011972c055ade2bf1 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 18 Jul 2023 02:28:58 +0000 Subject: [PATCH] CodeGen from PR 24873 in Azure/azure-rest-api-specs Merge 5b675c21ce8ad9c99f70aaf57c89e0a17e568c96 into e1f8a06c495d417ed164f5681a05993169d7bbc2 --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 5 + .../README.md | 107 + .../SAMPLE.md | 3053 +++++++++++++++++ .../pom.xml | 61 + .../generated/AuthorizationManager.java | 1058 ++++++ ...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/AlertConfigurationsClient.java | 106 + .../fluent/AlertDefinitionsClient.java | 77 + .../fluent/AlertIncidentsClient.java | 109 + .../fluent/AlertOperationsClient.java | 41 + .../generated/fluent/AlertsClient.java | 215 ++ .../fluent/AuthorizationManagementClient.java | 363 ++ .../fluent/ClassicAdministratorsClient.java | 38 + .../fluent/DenyAssignmentsClient.java | 222 ++ .../fluent/EligibleChildResourcesClient.java | 45 + .../fluent/GlobalAdministratorsClient.java | 34 + .../generated/fluent/OperationsClient.java | 38 + .../generated/fluent/PermissionsClient.java | 83 + .../ProviderOperationsMetadatasClient.java | 65 + ...RoleAssignmentScheduleInstancesClient.java | 77 + .../RoleAssignmentScheduleRequestsClient.java | 182 + .../fluent/RoleAssignmentSchedulesClient.java | 73 + .../fluent/RoleAssignmentsClient.java | 359 ++ .../fluent/RoleDefinitionsClient.java | 183 + ...oleEligibilityScheduleInstancesClient.java | 79 + ...RoleEligibilityScheduleRequestsClient.java | 180 + .../RoleEligibilitySchedulesClient.java | 73 + .../fluent/RoleManagementPoliciesClient.java | 124 + ...RoleManagementPolicyAssignmentsClient.java | 136 + ...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 | 85 + .../AccessReviewContactedReviewerInner.java | 71 + ...cessReviewContactedReviewerProperties.java | 70 + .../models/AccessReviewDecisionInner.java | 282 ++ ...ewDecisionPrincipalResourceMembership.java | 59 + .../AccessReviewDecisionProperties.java | 413 +++ .../models/AccessReviewDecisionResource.java | 90 + .../AccessReviewDefaultSettingsInner.java | 427 +++ .../AccessReviewHistoryDefinitionInner.java | 365 ++ ...cessReviewHistoryDefinitionProperties.java | 429 +++ .../AccessReviewHistoryInstanceInner.java | 211 ++ ...AccessReviewHistoryInstanceProperties.java | 227 ++ .../AccessReviewHistoryScheduleSettings.java | 207 ++ .../models/AccessReviewInstanceInner.java | 160 + .../AccessReviewInstanceProperties.java | 173 + .../models/AccessReviewRecurrencePattern.java | 79 + .../models/AccessReviewRecurrenceRange.java | 134 + .../AccessReviewRecurrenceSettings.java | 207 ++ .../AccessReviewScheduleDefinitionInner.java | 724 ++++ ...essReviewScheduleDefinitionProperties.java | 889 +++++ .../models/AccessReviewScheduleSettings.java | 456 +++ .../fluent/models/AccessReviewScope.java | 249 ++ .../models/AlertConfigurationInner.java | 98 + .../AlertConfigurationPropertiesInner.java | 125 + .../fluent/models/AlertDefinitionInner.java | 169 + .../models/AlertDefinitionProperties.java | 160 + .../fluent/models/AlertIncidentInner.java | 99 + .../generated/fluent/models/AlertInner.java | 176 + .../models/AlertOperationResultInner.java | 115 + .../fluent/models/AlertPropertiesInner.java | 167 + .../models/ClassicAdministratorInner.java | 166 + .../ClassicAdministratorProperties.java | 76 + .../fluent/models/DenyAssignmentInner.java | 365 ++ .../models/DenyAssignmentProperties.java | 367 ++ .../models/EligibleChildResourceInner.java | 69 + .../fluent/models/OperationInner.java | 132 + .../fluent/models/PermissionInner.java | 163 + .../ProviderOperationsMetadataInner.java | 189 + .../fluent/models/RoleAssignmentInner.java | 255 ++ .../models/RoleAssignmentProperties.java | 304 ++ .../models/RoleAssignmentScheduleInner.java | 469 +++ .../RoleAssignmentScheduleInstanceInner.java | 492 +++ ...eAssignmentScheduleInstanceProperties.java | 485 +++ .../RoleAssignmentScheduleProperties.java | 461 +++ .../RoleAssignmentScheduleRequestInner.java | 425 +++ ...leAssignmentScheduleRequestProperties.java | 469 +++ .../fluent/models/RoleDefinitionInner.java | 196 ++ .../models/RoleDefinitionProperties.java | 219 ++ .../models/RoleEligibilityScheduleInner.java | 420 +++ .../RoleEligibilityScheduleInstanceInner.java | 395 +++ ...EligibilityScheduleInstanceProperties.java | 376 ++ .../RoleEligibilityScheduleProperties.java | 405 +++ .../RoleEligibilityScheduleRequestInner.java | 401 +++ ...eEligibilityScheduleRequestProperties.java | 443 +++ .../RoleManagementPolicyAssignmentInner.java | 166 + ...eManagementPolicyAssignmentProperties.java | 121 + .../models/RoleManagementPolicyInner.java | 243 ++ .../RoleManagementPolicyProperties.java | 231 ++ .../generated/fluent/models/package-info.java | 11 + .../generated/fluent/package-info.java | 11 + .../AccessReviewContactedReviewerImpl.java | 54 + .../AccessReviewDecisionImpl.java | 142 + .../AccessReviewDefaultSettingsImpl.java | 106 + ...ewDefaultSettingsOperationsClientImpl.java | 316 ++ ...ssReviewDefaultSettingsOperationsImpl.java | 83 + .../AccessReviewHistoryDefinitionImpl.java | 230 ++ ...wHistoryDefinitionInstancesClientImpl.java | 228 ++ ...sReviewHistoryDefinitionInstancesImpl.java | 62 + ...finitionInstancesOperationsClientImpl.java | 335 ++ ...toryDefinitionInstancesOperationsImpl.java | 48 + ...HistoryDefinitionOperationsClientImpl.java | 368 ++ ...ReviewHistoryDefinitionOperationsImpl.java | 46 + ...essReviewHistoryDefinitionsClientImpl.java | 479 +++ .../AccessReviewHistoryDefinitionsImpl.java | 71 + .../AccessReviewHistoryInstanceImpl.java | 75 + ...wInstanceContactedReviewersClientImpl.java | 350 ++ ...sReviewInstanceContactedReviewersImpl.java | 47 + ...cessReviewInstanceDecisionsClientImpl.java | 381 ++ .../AccessReviewInstanceDecisionsImpl.java | 48 + .../AccessReviewInstanceImpl.java | 162 + ...ssReviewInstanceMyDecisionsClientImpl.java | 692 ++++ .../AccessReviewInstanceMyDecisionsImpl.java | 104 + ...essReviewInstanceOperationsClientImpl.java | 800 +++++ .../AccessReviewInstanceOperationsImpl.java | 74 + ...ancesAssignedForMyApprovalsClientImpl.java | 468 +++ ...ewInstancesAssignedForMyApprovalsImpl.java | 73 + .../AccessReviewInstancesClientImpl.java | 696 ++++ .../AccessReviewInstancesImpl.java | 76 + .../AccessReviewScheduleDefinitionImpl.java | 535 +++ ...tionsAssignedForMyApprovalsClientImpl.java | 316 ++ ...DefinitionsAssignedForMyApprovalsImpl.java | 48 + ...ssReviewScheduleDefinitionsClientImpl.java | 922 +++++ .../AccessReviewScheduleDefinitionsImpl.java | 91 + .../AlertConfigurationImpl.java | 52 + .../AlertConfigurationPropertiesImpl.java | 52 + .../AlertConfigurationsClientImpl.java | 580 ++++ .../AlertConfigurationsImpl.java | 79 + .../implementation/AlertDefinitionImpl.java | 78 + .../AlertDefinitionsClientImpl.java | 442 +++ .../implementation/AlertDefinitionsImpl.java | 70 + .../generated/implementation/AlertImpl.java | 102 + .../implementation/AlertIncidentImpl.java | 46 + .../AlertIncidentsClientImpl.java | 613 ++++ .../implementation/AlertIncidentsImpl.java | 80 + .../AlertOperationResultImpl.java | 54 + .../AlertOperationsClientImpl.java | 176 + .../implementation/AlertOperationsImpl.java | 59 + .../implementation/AlertPropertiesImpl.java | 91 + .../implementation/AlertsClientImpl.java | 999 ++++++ .../generated/implementation/AlertsImpl.java | 116 + .../AuthorizationManagementClientBuilder.java | 144 + .../AuthorizationManagementClientImpl.java | 923 +++++ .../ClassicAdministratorImpl.java | 49 + .../ClassicAdministratorsClientImpl.java | 294 ++ .../ClassicAdministratorsImpl.java | 46 + .../implementation/DenyAssignmentImpl.java | 117 + .../DenyAssignmentsClientImpl.java | 1696 +++++++++ .../implementation/DenyAssignmentsImpl.java | 149 + .../EligibleChildResourceImpl.java | 41 + .../EligibleChildResourcesClientImpl.java | 333 ++ .../EligibleChildResourcesImpl.java | 46 + .../GlobalAdministratorsClientImpl.java | 145 + .../GlobalAdministratorsImpl.java | 42 + .../implementation/OperationImpl.java | 46 + .../implementation/OperationsClientImpl.java | 277 ++ .../implementation/OperationsImpl.java | 46 + .../implementation/PermissionImpl.java | 75 + .../implementation/PermissionsClientImpl.java | 700 ++++ .../implementation/PermissionsImpl.java | 80 + .../ProviderOperationsMetadataImpl.java | 67 + ...ProviderOperationsMetadatasClientImpl.java | 427 +++ .../ProviderOperationsMetadatasImpl.java | 72 + .../implementation/RoleAssignmentImpl.java | 189 + .../RoleAssignmentScheduleImpl.java | 111 + .../RoleAssignmentScheduleInstanceImpl.java | 115 + ...AssignmentScheduleInstancesClientImpl.java | 498 +++ .../RoleAssignmentScheduleInstancesImpl.java | 73 + .../RoleAssignmentScheduleRequestImpl.java | 261 ++ ...eAssignmentScheduleRequestsClientImpl.java | 1013 ++++++ .../RoleAssignmentScheduleRequestsImpl.java | 178 + .../RoleAssignmentSchedulesClientImpl.java | 472 +++ .../RoleAssignmentSchedulesImpl.java | 72 + .../RoleAssignmentsClientImpl.java | 2317 +++++++++++++ .../implementation/RoleAssignmentsImpl.java | 226 ++ .../implementation/RoleDefinitionImpl.java | 216 ++ .../RoleDefinitionsClientImpl.java | 915 +++++ .../implementation/RoleDefinitionsImpl.java | 173 + .../RoleEligibilityScheduleImpl.java | 102 + .../RoleEligibilityScheduleInstanceImpl.java | 98 + ...ligibilityScheduleInstancesClientImpl.java | 500 +++ .../RoleEligibilityScheduleInstancesImpl.java | 74 + .../RoleEligibilityScheduleRequestImpl.java | 252 ++ ...EligibilityScheduleRequestsClientImpl.java | 1009 ++++++ .../RoleEligibilityScheduleRequestsImpl.java | 178 + .../RoleEligibilitySchedulesClientImpl.java | 474 +++ .../RoleEligibilitySchedulesImpl.java | 72 + .../RoleManagementPoliciesClientImpl.java | 714 ++++ .../RoleManagementPoliciesImpl.java | 106 + .../RoleManagementPolicyAssignmentImpl.java | 131 + ...ManagementPolicyAssignmentsClientImpl.java | 772 +++++ .../RoleManagementPolicyAssignmentsImpl.java | 213 ++ .../RoleManagementPolicyImpl.java | 93 + ...AccessReviewDefaultSettingsClientImpl.java | 303 ++ .../ScopeAccessReviewDefaultSettingsImpl.java | 84 + ...wHistoryDefinitionInstancesClientImpl.java | 223 ++ ...sReviewHistoryDefinitionInstancesImpl.java | 64 + ...finitionInstancesOperationsClientImpl.java | 325 ++ ...toryDefinitionInstancesOperationsImpl.java | 49 + ...HistoryDefinitionOperationsClientImpl.java | 346 ++ ...ReviewHistoryDefinitionOperationsImpl.java | 72 + ...essReviewHistoryDefinitionsClientImpl.java | 460 +++ ...opeAccessReviewHistoryDefinitionsImpl.java | 72 + ...wInstanceContactedReviewersClientImpl.java | 339 ++ ...sReviewInstanceContactedReviewersImpl.java | 50 + ...cessReviewInstanceDecisionsClientImpl.java | 379 ++ ...copeAccessReviewInstanceDecisionsImpl.java | 48 + ...essReviewInstanceOperationsClientImpl.java | 799 +++++ ...opeAccessReviewInstanceOperationsImpl.java | 86 + .../ScopeAccessReviewInstancesClientImpl.java | 681 ++++ .../ScopeAccessReviewInstancesImpl.java | 104 + ...ssReviewScheduleDefinitionsClientImpl.java | 875 +++++ ...peAccessReviewScheduleDefinitionsImpl.java | 118 + ...wInstanceContactedReviewersClientImpl.java | 323 ++ ...sReviewInstanceContactedReviewersImpl.java | 49 + .../generated/implementation/Utils.java | 204 ++ .../implementation/package-info.java | 11 + .../models/AccessRecommendationType.java | 50 + .../models/AccessReviewActorIdentityType.java | 47 + .../models/AccessReviewApplyResult.java | 60 + .../models/AccessReviewContactedReviewer.java | 61 + ...cessReviewContactedReviewerListResult.java | 81 + .../models/AccessReviewDecision.java | 184 + .../models/AccessReviewDecisionIdentity.java | 67 + .../models/AccessReviewDecisionInsight.java | 54 + ...AccessReviewDecisionInsightProperties.java | 51 + .../AccessReviewDecisionInsightType.java | 44 + .../AccessReviewDecisionListResult.java | 81 + ...cisionPrincipalResourceMembershipType.java | 48 + ...eviewDecisionServicePrincipalIdentity.java | 45 + .../AccessReviewDecisionUserIdentity.java | 45 + ...ewDecisionUserSignInInsightProperties.java | 45 + .../models/AccessReviewDefaultSettings.java | 162 + ...AccessReviewDefaultSettingsOperations.java | 55 + .../models/AccessReviewHistoryDefinition.java | 342 ++ ...ewHistoryDefinitionInstanceListResult.java | 81 + ...ccessReviewHistoryDefinitionInstances.java | 39 + ...wHistoryDefinitionInstancesOperations.java | 36 + ...cessReviewHistoryDefinitionListResult.java | 81 + ...cessReviewHistoryDefinitionOperations.java | 41 + .../AccessReviewHistoryDefinitionStatus.java | 57 + .../AccessReviewHistoryDefinitions.java | 59 + .../models/AccessReviewHistoryInstance.java | 102 + .../models/AccessReviewInstance.java | 192 ++ ...ccessReviewInstanceContactedReviewers.java | 36 + .../models/AccessReviewInstanceDecisions.java | 39 + .../AccessReviewInstanceListResult.java | 81 + .../AccessReviewInstanceMyDecisions.java | 104 + .../AccessReviewInstanceOperations.java | 131 + .../AccessReviewInstanceReviewersType.java | 54 + .../models/AccessReviewInstanceStatus.java | 74 + .../models/AccessReviewInstances.java | 71 + ...ReviewInstancesAssignedForMyApprovals.java | 63 + .../AccessReviewRecurrencePatternType.java | 47 + .../AccessReviewRecurrenceRangeType.java | 50 + .../generated/models/AccessReviewResult.java | 56 + .../models/AccessReviewReviewer.java | 65 + .../models/AccessReviewReviewerType.java | 47 + .../AccessReviewScheduleDefinition.java | 1010 ++++++ ...essReviewScheduleDefinitionListResult.java | 81 + ...ReviewScheduleDefinitionReviewersType.java | 55 + .../AccessReviewScheduleDefinitionStatus.java | 75 + .../AccessReviewScheduleDefinitions.java | 110 + ...duleDefinitionsAssignedForMyApprovals.java | 34 + .../AccessReviewScopeAssignmentState.java | 47 + .../AccessReviewScopePrincipalType.java | 56 + .../authorization/generated/models/Alert.java | 97 + .../generated/models/AlertConfiguration.java | 45 + .../models/AlertConfigurationListResult.java | 81 + .../models/AlertConfigurationProperties.java | 47 + .../generated/models/AlertConfigurations.java | 98 + .../generated/models/AlertDefinition.java | 101 + .../models/AlertDefinitionListResult.java | 81 + .../generated/models/AlertDefinitions.java | 70 + .../generated/models/AlertIncident.java | 45 + .../models/AlertIncidentListResult.java | 81 + .../models/AlertIncidentProperties.java | 46 + .../generated/models/AlertIncidents.java | 100 + .../generated/models/AlertListResult.java | 81 + .../models/AlertOperationResult.java | 60 + .../generated/models/AlertOperations.java | 36 + .../generated/models/AlertProperties.java | 76 + .../generated/models/Alerts.java | 145 + .../generated/models/ApprovalMode.java | 53 + .../generated/models/ApprovalSettings.java | 160 + .../generated/models/ApprovalStage.java | 191 ++ .../generated/models/AssignmentType.java | 47 + ...utsidePimAlertConfigurationProperties.java | 37 + ...gnedOutsidePimAlertIncidentProperties.java | 181 + .../models/ClassicAdministrator.java | 52 + .../ClassicAdministratorListResult.java | 81 + .../models/ClassicAdministrators.java | 33 + .../models/DecisionResourceType.java | 44 + .../generated/models/DecisionTargetType.java | 47 + .../generated/models/DefaultDecisionType.java | 50 + .../generated/models/DenyAssignment.java | 142 + .../models/DenyAssignmentListResult.java | 81 + .../models/DenyAssignmentPermission.java | 183 + .../generated/models/DenyAssignments.java | 207 ++ ...leCreatedAlertConfigurationProperties.java | 37 + ...ateRoleCreatedAlertIncidentProperties.java | 75 + .../models/EligibleChildResource.java | 38 + .../models/EligibleChildResources.java | 40 + .../EligibleChildResourcesListResult.java | 81 + .../generated/models/EnablementRules.java | 50 + .../generated/models/ExpandedProperties.java | 111 + .../models/ExpandedPropertiesPrincipal.java | 128 + .../ExpandedPropertiesRoleDefinition.java | 102 + .../models/ExpandedPropertiesScope.java | 102 + .../models/GlobalAdministrators.java | 30 + .../generated/models/MemberType.java | 50 + .../models/NotificationDeliveryMechanism.java | 44 + .../generated/models/NotificationLevel.java | 50 + .../generated/models/Operation.java | 45 + .../generated/models/OperationDisplay.java | 84 + .../generated/models/OperationListResult.java | 81 + .../generated/models/Operations.java | 33 + .../generated/models/Permission.java | 62 + .../generated/models/PermissionGetResult.java | 81 + .../generated/models/Permissions.java | 76 + .../models/PolicyAssignmentProperties.java | 111 + .../PolicyAssignmentPropertiesPolicy.java | 95 + ...icyAssignmentPropertiesRoleDefinition.java | 102 + .../PolicyAssignmentPropertiesScope.java | 102 + .../generated/models/PolicyProperties.java | 42 + .../models/PolicyPropertiesScope.java | 102 + .../generated/models/Principal.java | 128 + .../generated/models/PrincipalType.java | 56 + .../generated/models/ProviderOperation.java | 180 + .../models/ProviderOperationsMetadata.java | 61 + .../ProviderOperationsMetadataListResult.java | 81 + .../models/ProviderOperationsMetadatas.java | 58 + .../generated/models/RecipientType.java | 50 + .../models/RecordAllDecisionsProperties.java | 106 + .../models/RecordAllDecisionsResult.java | 47 + .../generated/models/RequestType.java | 68 + .../generated/models/ResourceType.java | 106 + .../generated/models/RoleAssignment.java | 279 ++ .../RoleAssignmentCreateParameters.java | 263 ++ .../models/RoleAssignmentListResult.java | 70 + .../models/RoleAssignmentSchedule.java | 156 + .../RoleAssignmentScheduleInstance.java | 162 + ...eAssignmentScheduleInstanceListResult.java | 81 + .../RoleAssignmentScheduleInstances.java | 70 + .../RoleAssignmentScheduleListResult.java | 81 + .../models/RoleAssignmentScheduleRequest.java | 430 +++ ...leAssignmentScheduleRequestListResult.java | 81 + ...ScheduleRequestPropertiesScheduleInfo.java | 81 + ...questPropertiesScheduleInfoExpiration.java | 103 + ...ntScheduleRequestPropertiesTicketInfo.java | 76 + .../RoleAssignmentScheduleRequests.java | 155 + .../models/RoleAssignmentSchedules.java | 65 + .../generated/models/RoleAssignments.java | 308 ++ .../generated/models/RoleDefinition.java | 314 ++ .../models/RoleDefinitionListResult.java | 81 + .../generated/models/RoleDefinitions.java | 167 + .../models/RoleEligibilitySchedule.java | 141 + .../RoleEligibilityScheduleInstance.java | 133 + ...EligibilityScheduleInstanceListResult.java | 81 + .../RoleEligibilityScheduleInstances.java | 70 + .../RoleEligibilityScheduleListResult.java | 81 + .../RoleEligibilityScheduleRequest.java | 407 +++ ...eEligibilityScheduleRequestListResult.java | 81 + ...ScheduleRequestPropertiesScheduleInfo.java | 81 + ...questPropertiesScheduleInfoExpiration.java | 103 + ...tyScheduleRequestPropertiesTicketInfo.java | 76 + .../RoleEligibilityScheduleRequests.java | 155 + .../models/RoleEligibilitySchedules.java | 66 + .../models/RoleManagementPolicies.java | 113 + .../models/RoleManagementPolicy.java | 103 + .../RoleManagementPolicyApprovalRule.java | 73 + .../RoleManagementPolicyAssignment.java | 160 + ...eManagementPolicyAssignmentListResult.java | 81 + .../RoleManagementPolicyAssignments.java | 145 + ...gementPolicyAuthenticationContextRule.java | 96 + .../RoleManagementPolicyEnablementRule.java | 71 + .../RoleManagementPolicyExpirationRule.java | 96 + .../RoleManagementPolicyListResult.java | 81 + .../RoleManagementPolicyNotificationRule.java | 177 + .../models/RoleManagementPolicyRule.java | 99 + .../RoleManagementPolicyRuleTarget.java | 181 + .../models/RoleManagementPolicyRuleType.java | 61 + .../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 + .../generated/models/SeverityLevel.java | 50 + .../generated/models/Status.java | 107 + ...ccessReviewInstanceContactedReviewers.java | 36 + ...oResourceAlertConfigurationProperties.java | 96 + ...gnedToResourceAlertIncidentProperties.java | 60 + ...oResourceAlertConfigurationProperties.java | 97 + ...gnedToResourceAlertIncidentProperties.java | 60 + .../authorization/generated/models/Type.java | 50 + .../generated/models/UserSet.java | 128 + .../generated/models/UserType.java | 47 + .../generated/models/package-info.java | 11 + .../authorization/generated/package-info.java | 11 + .../src/main/java/module-info.java | 19 + ...viewInstanceMyDecisionsGetByIdSamples.java | 27 + ...sReviewInstanceMyDecisionsListSamples.java | 27 + ...ReviewInstanceMyDecisionsPatchSamples.java | 30 + ...OperationAcceptRecommendationsSamples.java | 25 + ...esAssignedForMyApprovalGetByIdSamples.java | 26 + ...ancesAssignedForMyApprovalListSamples.java | 23 + ...tionsAssignedForMyApprovalListSamples.java | 23 + .../AlertConfigurationsGetSamples.java | 26 + ...lertConfigurationsListForScopeSamples.java | 23 + .../AlertConfigurationsUpdateSamples.java | 34 + .../generated/AlertDefinitionsGetSamples.java | 26 + .../AlertDefinitionsListForScopeSamples.java | 23 + .../generated/AlertIncidentsGetSamples.java | 27 + .../AlertIncidentsListForScopeSamples.java | 26 + .../AlertIncidentsRemediateSamples.java | 27 + .../generated/AlertOperationGetSamples.java | 26 + .../generated/generated/AlertsGetSamples.java | 25 + .../generated/AlertsListForScopeSamples.java | 22 + .../generated/AlertsRefreshAllSamples.java | 23 + .../generated/AlertsRefreshSamples.java | 25 + .../generated/AlertsUpdateSamples.java | 28 + .../ClassicAdministratorsListSamples.java | 21 + .../DenyAssignmentsGetByIdSamples.java | 25 + .../generated/DenyAssignmentsGetSamples.java | 24 + ...AssignmentsListByResourceGroupSamples.java | 21 + ...DenyAssignmentsListForResourceSamples.java | 30 + .../DenyAssignmentsListForScopeSamples.java | 21 + .../generated/DenyAssignmentsListSamples.java | 21 + .../EligibleChildResourcesGetSamples.java | 26 + ...obalAdministratorElevateAccessSamples.java | 21 + ...PermissionsListByResourceGroupSamples.java | 21 + .../PermissionsListForResourceSamples.java | 29 + .../ProviderOperationsMetadataGetSamples.java | 23 + ...ProviderOperationsMetadataListSamples.java | 21 + ...AssignmentScheduleInstancesGetSamples.java | 26 + ...tScheduleInstancesListForScopeSamples.java | 26 + ...signmentScheduleRequestsCancelSamples.java | 26 + ...signmentScheduleRequestsCreateSamples.java | 47 + ...eAssignmentScheduleRequestsGetSamples.java | 26 + ...ntScheduleRequestsListForScopeSamples.java | 26 + ...gnmentScheduleRequestsValidateSamples.java | 50 + .../RoleAssignmentSchedulesGetSamples.java | 26 + ...ssignmentSchedulesListForScopeSamples.java | 26 + .../RoleAssignmentsCreateByIdSamples.java | 33 + .../RoleAssignmentsCreateSamples.java | 74 + .../RoleAssignmentsDeleteByIdSamples.java | 26 + .../RoleAssignmentsDeleteSamples.java | 27 + .../RoleAssignmentsGetByIdSamples.java | 26 + .../generated/RoleAssignmentsGetSamples.java | 27 + ...AssignmentsListByResourceGroupSamples.java | 21 + ...RoleAssignmentsListForResourceSamples.java | 30 + .../RoleAssignmentsListForScopeSamples.java | 28 + .../generated/RoleAssignmentsListSamples.java | 21 + .../RoleDefinitionsCreateOrUpdateSamples.java | 21 + .../RoleDefinitionsDeleteSamples.java | 23 + .../RoleDefinitionsGetByIdSamples.java | 21 + .../generated/RoleDefinitionsGetSamples.java | 21 + .../generated/RoleDefinitionsListSamples.java | 21 + ...ligibilityScheduleInstancesGetSamples.java | 26 + ...yScheduleInstancesListForScopeSamples.java | 26 + ...gibilityScheduleRequestsCancelSamples.java | 26 + ...gibilityScheduleRequestsCreateSamples.java | 46 + ...EligibilityScheduleRequestsGetSamples.java | 26 + ...tyScheduleRequestsListForScopeSamples.java | 26 + ...bilityScheduleRequestsValidateSamples.java | 49 + .../RoleEligibilitySchedulesGetSamples.java | 26 + ...igibilitySchedulesListForScopeSamples.java | 26 + .../RoleManagementPoliciesDeleteSamples.java | 26 + .../RoleManagementPoliciesGetSamples.java | 26 + ...ManagementPoliciesListForScopeSamples.java | 25 + .../RoleManagementPoliciesUpdateSamples.java | 303 ++ ...agementPolicyAssignmentsCreateSamples.java | 30 + ...agementPolicyAssignmentsDeleteSamples.java | 26 + ...ManagementPolicyAssignmentsGetSamples.java | 26 + ...tPolicyAssignmentsListForScopeSamples.java | 25 + ...AccessReviewDefaultSettingsGetSamples.java | 23 + ...AccessReviewDefaultSettingsPutSamples.java | 28 + ...ionInstanceGenerateDownloadUriSamples.java | 27 + ...finitionInstancesOperationListSamples.java | 26 + ...storyDefinitionOperationCreateSamples.java | 29 + ...yDefinitionOperationDeleteByIdSamples.java | 26 + ...eviewHistoryDefinitionsGetByIdSamples.java | 26 + ...ssReviewHistoryDefinitionsListSamples.java | 23 + ...InstanceContactedReviewersListSamples.java | 27 + ...essReviewInstanceDecisionsListSamples.java | 28 + ...nstanceOperationApplyDecisionsSamples.java | 26 + ...nceOperationRecordAllDecisionsSamples.java | 30 + ...nstanceOperationResetDecisionsSamples.java | 26 + ...InstanceOperationSendRemindersSamples.java | 26 + ...essReviewInstanceOperationStopSamples.java | 26 + ...opeAccessReviewInstancesCreateSamples.java | 30 + ...peAccessReviewInstancesGetByIdSamples.java | 27 + ...ScopeAccessReviewInstancesListSamples.java | 27 + ...eDefinitionsCreateOrUpdateByIdSamples.java | 28 + ...wScheduleDefinitionsDeleteByIdSamples.java | 26 + ...viewScheduleDefinitionsGetByIdSamples.java | 25 + ...sReviewScheduleDefinitionsListSamples.java | 23 + ...sReviewScheduleDefinitionsStopSamples.java | 25 + ...InstanceContactedReviewersListSamples.java | 26 + sdk/authorization/ci.yml | 47 + sdk/authorization/pom.xml | 15 + 529 files changed, 81355 insertions(+) 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/AlertConfigurationsClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AlertDefinitionsClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AlertIncidentsClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AlertOperationsClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AlertsClient.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/ClassicAdministratorsClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/DenyAssignmentsClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/EligibleChildResourcesClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/GlobalAdministratorsClient.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/PermissionsClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ProviderOperationsMetadatasClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleAssignmentScheduleInstancesClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleAssignmentScheduleRequestsClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleAssignmentSchedulesClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleAssignmentsClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleDefinitionsClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleEligibilityScheduleInstancesClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleEligibilityScheduleRequestsClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleEligibilitySchedulesClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleManagementPoliciesClient.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleManagementPolicyAssignmentsClient.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/AccessReviewDecisionInner.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/AlertConfigurationInner.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AlertConfigurationPropertiesInner.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AlertDefinitionInner.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AlertDefinitionProperties.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AlertIncidentInner.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AlertInner.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AlertOperationResultInner.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AlertPropertiesInner.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/ClassicAdministratorInner.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/ClassicAdministratorProperties.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/DenyAssignmentInner.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/DenyAssignmentProperties.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/EligibleChildResourceInner.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/PermissionInner.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/ProviderOperationsMetadataInner.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleAssignmentInner.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleAssignmentProperties.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleAssignmentScheduleInner.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleAssignmentScheduleInstanceInner.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleAssignmentScheduleInstanceProperties.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleAssignmentScheduleProperties.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleAssignmentScheduleRequestInner.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleAssignmentScheduleRequestProperties.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleDefinitionInner.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleDefinitionProperties.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleEligibilityScheduleInner.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleEligibilityScheduleInstanceInner.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleEligibilityScheduleInstanceProperties.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleEligibilityScheduleProperties.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleEligibilityScheduleRequestInner.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleEligibilityScheduleRequestProperties.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleManagementPolicyAssignmentInner.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleManagementPolicyAssignmentProperties.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleManagementPolicyInner.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleManagementPolicyProperties.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/AlertConfigurationImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertConfigurationPropertiesImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertConfigurationsClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertConfigurationsImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertDefinitionImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertDefinitionsClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertDefinitionsImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertIncidentImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertIncidentsClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertIncidentsImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertOperationResultImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertOperationsClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertOperationsImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertPropertiesImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertsClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertsImpl.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/ClassicAdministratorImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ClassicAdministratorsClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ClassicAdministratorsImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/DenyAssignmentImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/DenyAssignmentsClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/DenyAssignmentsImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/EligibleChildResourceImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/EligibleChildResourcesClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/EligibleChildResourcesImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/GlobalAdministratorsClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/GlobalAdministratorsImpl.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/PermissionImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/PermissionsClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/PermissionsImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ProviderOperationsMetadataImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ProviderOperationsMetadatasClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ProviderOperationsMetadatasImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleAssignmentImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleAssignmentScheduleImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleAssignmentScheduleInstanceImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleAssignmentScheduleInstancesClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleAssignmentScheduleInstancesImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleAssignmentScheduleRequestImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleAssignmentScheduleRequestsClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleAssignmentScheduleRequestsImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleAssignmentSchedulesClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleAssignmentSchedulesImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleAssignmentsClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleAssignmentsImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleDefinitionImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleDefinitionsClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleDefinitionsImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleEligibilityScheduleImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleEligibilityScheduleInstanceImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleEligibilityScheduleInstancesClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleEligibilityScheduleInstancesImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleEligibilityScheduleRequestImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleEligibilityScheduleRequestsClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleEligibilityScheduleRequestsImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleEligibilitySchedulesClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleEligibilitySchedulesImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleManagementPoliciesClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleManagementPoliciesImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleManagementPolicyAssignmentImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleManagementPolicyAssignmentsClientImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleManagementPolicyAssignmentsImpl.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleManagementPolicyImpl.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/AccessReviewDecisionIdentity.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/AccessReviewDecisionInsightProperties.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/Alert.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertConfiguration.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertConfigurationListResult.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertConfigurationProperties.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertConfigurations.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertDefinition.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertDefinitionListResult.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertDefinitions.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertIncident.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertIncidentListResult.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertIncidentProperties.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertIncidents.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertListResult.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertOperationResult.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertOperations.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertProperties.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/Alerts.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ApprovalMode.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ApprovalSettings.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ApprovalStage.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AssignmentType.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AzureRolesAssignedOutsidePimAlertConfigurationProperties.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AzureRolesAssignedOutsidePimAlertIncidentProperties.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ClassicAdministrator.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ClassicAdministratorListResult.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ClassicAdministrators.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/DenyAssignment.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/DenyAssignmentListResult.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/DenyAssignmentPermission.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/DenyAssignments.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/DuplicateRoleCreatedAlertConfigurationProperties.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/DuplicateRoleCreatedAlertIncidentProperties.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/EligibleChildResource.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/EligibleChildResources.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/EligibleChildResourcesListResult.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/EnablementRules.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ExpandedProperties.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ExpandedPropertiesPrincipal.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ExpandedPropertiesRoleDefinition.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ExpandedPropertiesScope.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/GlobalAdministrators.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/MemberType.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/NotificationDeliveryMechanism.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/NotificationLevel.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/Permission.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/PermissionGetResult.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/Permissions.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/PolicyAssignmentProperties.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/PolicyAssignmentPropertiesPolicy.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/PolicyAssignmentPropertiesRoleDefinition.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/PolicyAssignmentPropertiesScope.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/PolicyProperties.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/PolicyPropertiesScope.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/Principal.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/PrincipalType.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ProviderOperation.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ProviderOperationsMetadata.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ProviderOperationsMetadataListResult.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ProviderOperationsMetadatas.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RecipientType.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/RequestType.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ResourceType.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignment.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentCreateParameters.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentListResult.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentSchedule.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentScheduleInstance.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentScheduleInstanceListResult.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentScheduleInstances.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentScheduleListResult.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentScheduleRequest.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentScheduleRequestListResult.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentScheduleRequestPropertiesScheduleInfo.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentScheduleRequestPropertiesTicketInfo.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentScheduleRequests.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentSchedules.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignments.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleDefinition.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleDefinitionListResult.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleDefinitions.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilitySchedule.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilityScheduleInstance.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilityScheduleInstanceListResult.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilityScheduleInstances.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilityScheduleListResult.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilityScheduleRequest.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilityScheduleRequestListResult.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilityScheduleRequestPropertiesScheduleInfo.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilityScheduleRequestPropertiesTicketInfo.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilityScheduleRequests.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilitySchedules.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicies.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicy.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyApprovalRule.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyAssignment.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyAssignmentListResult.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyAssignments.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyAuthenticationContextRule.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyEnablementRule.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyExpirationRule.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyListResult.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyNotificationRule.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyRule.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyRuleTarget.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyRuleType.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/SeverityLevel.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/Status.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/TooManyOwnersAssignedToResourceAlertConfigurationProperties.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/TooManyOwnersAssignedToResourceAlertIncidentProperties.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/TooManyPermanentOwnersAssignedToResourceAlertConfigurationProperties.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/TooManyPermanentOwnersAssignedToResourceAlertIncidentProperties.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/Type.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/UserSet.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/UserType.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/AlertConfigurationsGetSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertConfigurationsListForScopeSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertConfigurationsUpdateSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertDefinitionsGetSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertDefinitionsListForScopeSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertIncidentsGetSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertIncidentsListForScopeSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertIncidentsRemediateSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertOperationGetSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertsGetSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertsListForScopeSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertsRefreshAllSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertsRefreshSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertsUpdateSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ClassicAdministratorsListSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/DenyAssignmentsGetByIdSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/DenyAssignmentsGetSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/DenyAssignmentsListByResourceGroupSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/DenyAssignmentsListForResourceSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/DenyAssignmentsListForScopeSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/DenyAssignmentsListSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/EligibleChildResourcesGetSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/GlobalAdministratorElevateAccessSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/PermissionsListByResourceGroupSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/PermissionsListForResourceSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ProviderOperationsMetadataGetSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ProviderOperationsMetadataListSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentScheduleInstancesGetSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentScheduleInstancesListForScopeSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentScheduleRequestsCancelSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentScheduleRequestsCreateSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentScheduleRequestsGetSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentScheduleRequestsListForScopeSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentScheduleRequestsValidateSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentSchedulesGetSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentSchedulesListForScopeSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsCreateByIdSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsCreateSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsDeleteByIdSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsDeleteSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsGetByIdSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsGetSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsListByResourceGroupSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsListForResourceSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsListForScopeSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsListSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleDefinitionsCreateOrUpdateSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleDefinitionsDeleteSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleDefinitionsGetByIdSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleDefinitionsGetSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleDefinitionsListSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleEligibilityScheduleInstancesGetSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleEligibilityScheduleInstancesListForScopeSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleEligibilityScheduleRequestsCancelSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleEligibilityScheduleRequestsCreateSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleEligibilityScheduleRequestsGetSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleEligibilityScheduleRequestsListForScopeSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleEligibilityScheduleRequestsValidateSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleEligibilitySchedulesGetSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleEligibilitySchedulesListForScopeSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleManagementPoliciesDeleteSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleManagementPoliciesGetSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleManagementPoliciesListForScopeSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleManagementPoliciesUpdateSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleManagementPolicyAssignmentsCreateSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleManagementPolicyAssignmentsDeleteSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleManagementPolicyAssignmentsGetSamples.java create mode 100644 sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleManagementPolicyAssignmentsListForScopeSamples.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 491739dedfb9..06f0d337aa4a 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -418,6 +418,7 @@ com.azure.resourcemanager:azure-resourcemanager-networkcloud;1.0.0-beta.2;1.0.0- com.azure.resourcemanager:azure-resourcemanager-cosmosdbforpostgresql;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-managementgroups;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-managednetworkfabric;1.0.0-beta.1;1.0.0-beta.2 +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 ec8e0f2ae458..b89298e0d916 100644 --- a/pom.xml +++ b/pom.xml @@ -23,6 +23,7 @@ sdk/appcontainers sdk/applicationinsights sdk/attestation + sdk/authorization sdk/automanage sdk/automation sdk/avs 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 000000000000..1634f896a4a5 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2023-07-18) + +- Azure Resource Manager Authorization client library for Java. This package contains Microsoft Azure SDK for Authorization Management SDK. Role based access control provides you a way to apply granular level policy administration down to individual resources or resource groups. These operations enable you to manage role definitions and role assignments. A role definition describes the set of actions that can be performed on resources. A role assignment grants access to Azure Active Directory users. Package tag package-2022-05-01-preview. 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 000000000000..8615b7840aee --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/README.md @@ -0,0 +1,107 @@ +# 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. Role based access control provides you a way to apply granular level policy administration down to individual resources or resource groups. These operations enable you to manage role definitions and role assignments. A role definition describes the set of actions that can be performed on resources. A role assignment grants access to Azure Active Directory users. Package tag package-2022-05-01-preview. 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] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configuration of the 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 `AZURE_SUBSCRIPTION_ID` environment variable. + +With above configuration, `azure` client can be authenticated using the 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][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. + + +[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 +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fauthorization%2Fazure-resourcemanager-authorization-generated%2FREADME.png) 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 000000000000..48d6ce88aaaa --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/SAMPLE.md @@ -0,0 +1,3053 @@ +# 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) + +## AlertConfigurations + +- [Get](#alertconfigurations_get) +- [ListForScope](#alertconfigurations_listforscope) +- [Update](#alertconfigurations_update) + +## AlertDefinitions + +- [Get](#alertdefinitions_get) +- [ListForScope](#alertdefinitions_listforscope) + +## AlertIncidents + +- [Get](#alertincidents_get) +- [ListForScope](#alertincidents_listforscope) +- [Remediate](#alertincidents_remediate) + +## AlertOperation + +- [Get](#alertoperation_get) + +## Alerts + +- [Get](#alerts_get) +- [ListForScope](#alerts_listforscope) +- [Refresh](#alerts_refresh) +- [RefreshAll](#alerts_refreshall) +- [Update](#alerts_update) + +## ClassicAdministrators + +- [List](#classicadministrators_list) + +## DenyAssignments + +- [Get](#denyassignments_get) +- [GetById](#denyassignments_getbyid) +- [List](#denyassignments_list) +- [ListByResourceGroup](#denyassignments_listbyresourcegroup) +- [ListForResource](#denyassignments_listforresource) +- [ListForScope](#denyassignments_listforscope) + +## EligibleChildResources + +- [Get](#eligiblechildresources_get) + +## GlobalAdministrator + +- [ElevateAccess](#globaladministrator_elevateaccess) + +## Permissions + +- [ListByResourceGroup](#permissions_listbyresourcegroup) +- [ListForResource](#permissions_listforresource) + +## ProviderOperationsMetadata + +- [Get](#provideroperationsmetadata_get) +- [List](#provideroperationsmetadata_list) + +## RoleAssignmentScheduleInstances + +- [Get](#roleassignmentscheduleinstances_get) +- [ListForScope](#roleassignmentscheduleinstances_listforscope) + +## RoleAssignmentScheduleRequests + +- [Cancel](#roleassignmentschedulerequests_cancel) +- [Create](#roleassignmentschedulerequests_create) +- [Get](#roleassignmentschedulerequests_get) +- [ListForScope](#roleassignmentschedulerequests_listforscope) +- [Validate](#roleassignmentschedulerequests_validate) + +## RoleAssignmentSchedules + +- [Get](#roleassignmentschedules_get) +- [ListForScope](#roleassignmentschedules_listforscope) + +## RoleAssignments + +- [Create](#roleassignments_create) +- [CreateById](#roleassignments_createbyid) +- [Delete](#roleassignments_delete) +- [DeleteById](#roleassignments_deletebyid) +- [Get](#roleassignments_get) +- [GetById](#roleassignments_getbyid) +- [List](#roleassignments_list) +- [ListByResourceGroup](#roleassignments_listbyresourcegroup) +- [ListForResource](#roleassignments_listforresource) +- [ListForScope](#roleassignments_listforscope) + +## RoleDefinitions + +- [CreateOrUpdate](#roledefinitions_createorupdate) +- [Delete](#roledefinitions_delete) +- [Get](#roledefinitions_get) +- [GetById](#roledefinitions_getbyid) +- [List](#roledefinitions_list) + +## RoleEligibilityScheduleInstances + +- [Get](#roleeligibilityscheduleinstances_get) +- [ListForScope](#roleeligibilityscheduleinstances_listforscope) + +## RoleEligibilityScheduleRequests + +- [Cancel](#roleeligibilityschedulerequests_cancel) +- [Create](#roleeligibilityschedulerequests_create) +- [Get](#roleeligibilityschedulerequests_get) +- [ListForScope](#roleeligibilityschedulerequests_listforscope) +- [Validate](#roleeligibilityschedulerequests_validate) + +## RoleEligibilitySchedules + +- [Get](#roleeligibilityschedules_get) +- [ListForScope](#roleeligibilityschedules_listforscope) + +## RoleManagementPolicies + +- [Delete](#rolemanagementpolicies_delete) +- [Get](#rolemanagementpolicies_get) +- [ListForScope](#rolemanagementpolicies_listforscope) +- [Update](#rolemanagementpolicies_update) + +## RoleManagementPolicyAssignments + +- [Create](#rolemanagementpolicyassignments_create) +- [Delete](#rolemanagementpolicyassignments_delete) +- [Get](#rolemanagementpolicyassignments_get) +- [ListForScope](#rolemanagementpolicyassignments_listforscope) + +## 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 +/** 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", + com.azure.core.util.Context.NONE); + } +} +``` + +### AccessReviewInstanceMyDecisions_List + +```java +/** 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, + com.azure.core.util.Context.NONE); + } +} +``` + +### AccessReviewInstanceMyDecisions_Patch + +```java +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(), + com.azure.core.util.Context.NONE); + } +} +``` + +### AccessReviewInstanceOperation_AcceptRecommendations + +```java +/** 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", + com.azure.core.util.Context.NONE); + } +} +``` + +### AccessReviewInstancesAssignedForMyApproval_GetById + +```java +/** 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", + com.azure.core.util.Context.NONE); + } +} +``` + +### AccessReviewInstancesAssignedForMyApproval_List + +```java +/** 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()", com.azure.core.util.Context.NONE); + } +} +``` + +### AccessReviewScheduleDefinitionsAssignedForMyApproval_List + +```java +/** 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()", com.azure.core.util.Context.NONE); + } +} +``` + +### AlertConfigurations_Get + +```java +/** Samples for AlertConfigurations Get. */ +public final class AlertConfigurationsGetSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-08-01-preview/examples/GetAlertConfigurationById.json + */ + /** + * Sample code: GetAlertConfigurationById. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAlertConfigurationById( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .alertConfigurations() + .getWithResponse( + "subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", + "TooManyOwnersAssignedToResource", + com.azure.core.util.Context.NONE); + } +} +``` + +### AlertConfigurations_ListForScope + +```java +/** Samples for AlertConfigurations ListForScope. */ +public final class AlertConfigurationsListForScopeSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-08-01-preview/examples/GetAlertConfigurations.json + */ + /** + * Sample code: GetAlertConfigurations. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAlertConfigurations( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .alertConfigurations() + .listForScope("subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", com.azure.core.util.Context.NONE); + } +} +``` + +### AlertConfigurations_Update + +```java +import com.azure.resourcemanager.authorization.generated.fluent.models.AlertConfigurationInner; +import com.azure.resourcemanager.authorization.generated.models.TooManyOwnersAssignedToResourceAlertConfigurationProperties; + +/** Samples for AlertConfigurations Update. */ +public final class AlertConfigurationsUpdateSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-08-01-preview/examples/UpdateAlertConfiguration.json + */ + /** + * Sample code: UpdateAlertConfiguration. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void updateAlertConfiguration( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .alertConfigurations() + .updateWithResponse( + "subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", + "TooManyOwnersAssignedToResource", + new AlertConfigurationInner() + .withProperties( + new TooManyOwnersAssignedToResourceAlertConfigurationProperties() + .withIsEnabled(true) + .withThresholdNumberOfOwners(2)), + com.azure.core.util.Context.NONE); + } +} +``` + +### AlertDefinitions_Get + +```java +/** Samples for AlertDefinitions Get. */ +public final class AlertDefinitionsGetSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-08-01-preview/examples/GetAlertDefinitionById.json + */ + /** + * Sample code: GetAlertDefinitionById. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAlertDefinitionById( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .alertDefinitions() + .getWithResponse( + "subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", + "TooManyPermanentOwnersAssignedToResource", + com.azure.core.util.Context.NONE); + } +} +``` + +### AlertDefinitions_ListForScope + +```java +/** Samples for AlertDefinitions ListForScope. */ +public final class AlertDefinitionsListForScopeSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-08-01-preview/examples/GetAlertDefinitions.json + */ + /** + * Sample code: GetAlertDefinitions. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAlertDefinitions( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .alertDefinitions() + .listForScope("subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", com.azure.core.util.Context.NONE); + } +} +``` + +### AlertIncidents_Get + +```java +/** Samples for AlertIncidents Get. */ +public final class AlertIncidentsGetSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-08-01-preview/examples/GetAlertIncidentById.json + */ + /** + * Sample code: GetAlertIncidentById. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAlertIncidentById( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .alertIncidents() + .getWithResponse( + "subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", + "TooManyOwnersAssignedToResource", + "5cf9ee65-d22e-4784-8b17-3de1c3b7bdcc", + com.azure.core.util.Context.NONE); + } +} +``` + +### AlertIncidents_ListForScope + +```java +/** Samples for AlertIncidents ListForScope. */ +public final class AlertIncidentsListForScopeSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-08-01-preview/examples/GetAlertIncidents.json + */ + /** + * Sample code: GetAlertIncidents. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAlertIncidents( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .alertIncidents() + .listForScope( + "subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", + "TooManyOwnersAssignedToResource", + com.azure.core.util.Context.NONE); + } +} +``` + +### AlertIncidents_Remediate + +```java +/** Samples for AlertIncidents Remediate. */ +public final class AlertIncidentsRemediateSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-08-01-preview/examples/RemediateAlertIncident.json + */ + /** + * Sample code: RemediateAlertIncident. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void remediateAlertIncident( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .alertIncidents() + .remediateWithResponse( + "subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", + "DuplicateRoleCreated", + "0645231d-16ba-4ebf-851a-0875df4052bd", + com.azure.core.util.Context.NONE); + } +} +``` + +### AlertOperation_Get + +```java +/** Samples for AlertOperation Get. */ +public final class AlertOperationGetSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-08-01-preview/examples/GetAlertOperationById.json + */ + /** + * Sample code: GetAlertOperation. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAlertOperation( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .alertOperations() + .getWithResponse( + "subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", + "{operationId}", + com.azure.core.util.Context.NONE); + } +} +``` + +### Alerts_Get + +```java +/** Samples for Alerts Get. */ +public final class AlertsGetSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-08-01-preview/examples/GetAlertById.json + */ + /** + * Sample code: GetAlertById. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAlertById(com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .alerts() + .getWithResponse( + "subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", + "TooManyOwnersAssignedToResource", + com.azure.core.util.Context.NONE); + } +} +``` + +### Alerts_ListForScope + +```java +/** Samples for Alerts ListForScope. */ +public final class AlertsListForScopeSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-08-01-preview/examples/GetAlerts.json + */ + /** + * Sample code: GetAlerts. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAlerts(com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .alerts() + .listForScope("subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", com.azure.core.util.Context.NONE); + } +} +``` + +### Alerts_Refresh + +```java +/** Samples for Alerts Refresh. */ +public final class AlertsRefreshSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-08-01-preview/examples/RefreshAlert.json + */ + /** + * Sample code: RefreshAlert. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void refreshAlert(com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .alerts() + .refresh( + "subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", + "AzureRolesAssignedOutsidePimAlert", + com.azure.core.util.Context.NONE); + } +} +``` + +### Alerts_RefreshAll + +```java +/** Samples for Alerts RefreshAll. */ +public final class AlertsRefreshAllSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-08-01-preview/examples/RefreshAllAlerts.json + */ + /** + * Sample code: RefreshAllAlerts. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void refreshAllAlerts( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .alerts() + .refreshAll("subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", com.azure.core.util.Context.NONE); + } +} +``` + +### Alerts_Update + +```java +import com.azure.resourcemanager.authorization.generated.fluent.models.AlertInner; + +/** Samples for Alerts Update. */ +public final class AlertsUpdateSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-08-01-preview/examples/UpdateAlert.json + */ + /** + * Sample code: DeactivateAlert. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void deactivateAlert(com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .alerts() + .updateWithResponse( + "subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", + "TooManyPermanentOwnersAssignedToResource", + new AlertInner().withIsActive(false), + com.azure.core.util.Context.NONE); + } +} +``` + +### ClassicAdministrators_List + +```java +/** Samples for ClassicAdministrators List. */ +public final class ClassicAdministratorsListSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2015-07-01/examples/GetClassicAdministrators.json + */ + /** + * Sample code: List classic administrators. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void listClassicAdministrators( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager.classicAdministrators().list(com.azure.core.util.Context.NONE); + } +} +``` + +### DenyAssignments_Get + +```java +/** Samples for DenyAssignments Get. */ +public final class DenyAssignmentsGetSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/GetDenyAssignmentByNameId.json + */ + /** + * Sample code: Get deny assignment by name. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getDenyAssignmentByName( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .denyAssignments() + .getWithResponse( + "subscriptions/subId/resourcegroups/rgname", "denyAssignmentId", com.azure.core.util.Context.NONE); + } +} +``` + +### DenyAssignments_GetById + +```java +/** Samples for DenyAssignments GetById. */ +public final class DenyAssignmentsGetByIdSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/GetDenyAssignmentById.json + */ + /** + * Sample code: Get deny assignment by ID. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getDenyAssignmentByID( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .denyAssignments() + .getByIdWithResponse( + "subscriptions/subId/resourcegroups/rgname/providers/Microsoft.Authorization/denyAssignments/daId", + com.azure.core.util.Context.NONE); + } +} +``` + +### DenyAssignments_List + +```java +/** Samples for DenyAssignments List. */ +public final class DenyAssignmentsListSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/GetAllDenyAssignments.json + */ + /** + * Sample code: List deny assignments for subscription. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void listDenyAssignmentsForSubscription( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager.denyAssignments().list(null, com.azure.core.util.Context.NONE); + } +} +``` + +### DenyAssignments_ListByResourceGroup + +```java +/** Samples for DenyAssignments ListByResourceGroup. */ +public final class DenyAssignmentsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/GetDenyAssignmentsForResourceGroup.json + */ + /** + * Sample code: List deny assignments for resource group. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void listDenyAssignmentsForResourceGroup( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager.denyAssignments().listByResourceGroup("rgname", null, com.azure.core.util.Context.NONE); + } +} +``` + +### DenyAssignments_ListForResource + +```java +/** Samples for DenyAssignments ListForResource. */ +public final class DenyAssignmentsListForResourceSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/GetDenyAssignmentsForResource.json + */ + /** + * Sample code: List deny assignments for resource. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void listDenyAssignmentsForResource( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .denyAssignments() + .listForResource( + "rgname", + "resourceProviderNamespace", + "parentResourcePath", + "resourceType", + "resourceName", + null, + com.azure.core.util.Context.NONE); + } +} +``` + +### DenyAssignments_ListForScope + +```java +/** Samples for DenyAssignments ListForScope. */ +public final class DenyAssignmentsListForScopeSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/GetDenyAssignmentByScope.json + */ + /** + * Sample code: List deny assignments for scope. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void listDenyAssignmentsForScope( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager.denyAssignments().listForScope("subscriptions/subId", null, com.azure.core.util.Context.NONE); + } +} +``` + +### EligibleChildResources_Get + +```java +/** Samples for EligibleChildResources Get. */ +public final class EligibleChildResourcesGetSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/examples/GetEligibleChildResourcesByScope.json + */ + /** + * Sample code: GetEligibleChildResourcesByScope. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getEligibleChildResourcesByScope( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .eligibleChildResources() + .get( + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "resourceType eq 'resourcegroup'", + com.azure.core.util.Context.NONE); + } +} +``` + +### GlobalAdministrator_ElevateAccess + +```java +/** Samples for GlobalAdministrator ElevateAccess. */ +public final class GlobalAdministratorElevateAccessSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2015-07-01/examples/ElevateAccess.json + */ + /** + * Sample code: Elevate access global administrator. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void elevateAccessGlobalAdministrator( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager.globalAdministrators().elevateAccessWithResponse(com.azure.core.util.Context.NONE); + } +} +``` + +### Permissions_ListByResourceGroup + +```java +/** Samples for Permissions ListByResourceGroup. */ +public final class PermissionsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-05-01-preview/examples/GetPermissions.json + */ + /** + * Sample code: List permissions for resource group. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void listPermissionsForResourceGroup( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager.permissions().listByResourceGroup("rgname", com.azure.core.util.Context.NONE); + } +} +``` + +### Permissions_ListForResource + +```java +/** Samples for Permissions ListForResource. */ +public final class PermissionsListForResourceSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-05-01-preview/examples/GetResourcePermissions.json + */ + /** + * Sample code: List permissions for resource. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void listPermissionsForResource( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .permissions() + .listForResource( + "rgname", + "rpnamespace", + "parentResourcePath", + "resourceType", + "resourceName", + com.azure.core.util.Context.NONE); + } +} +``` + +### ProviderOperationsMetadata_Get + +```java +/** Samples for ProviderOperationsMetadata Get. */ +public final class ProviderOperationsMetadataGetSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/GetProviderOperationsRP.json + */ + /** + * Sample code: List provider operations metadata for resource provider. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void listProviderOperationsMetadataForResourceProvider( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .providerOperationsMetadatas() + .getWithResponse("resourceProviderNamespace", null, com.azure.core.util.Context.NONE); + } +} +``` + +### ProviderOperationsMetadata_List + +```java +/** Samples for ProviderOperationsMetadata List. */ +public final class ProviderOperationsMetadataListSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/GetAllProviderOperations.json + */ + /** + * Sample code: List provider operations metadata for all resource providers. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void listProviderOperationsMetadataForAllResourceProviders( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager.providerOperationsMetadatas().list(null, com.azure.core.util.Context.NONE); + } +} +``` + +### RoleAssignmentScheduleInstances_Get + +```java +/** Samples for RoleAssignmentScheduleInstances Get. */ +public final class RoleAssignmentScheduleInstancesGetSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/examples/GetRoleAssignmentScheduleInstanceByName.json + */ + /** + * Sample code: GetRoleAssignmentScheduleInstanceByName. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleAssignmentScheduleInstanceByName( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleAssignmentScheduleInstances() + .getWithResponse( + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "ed9b8180-cef7-4c77-a63c-b8566ecfc412", + com.azure.core.util.Context.NONE); + } +} +``` + +### RoleAssignmentScheduleInstances_ListForScope + +```java +/** Samples for RoleAssignmentScheduleInstances ListForScope. */ +public final class RoleAssignmentScheduleInstancesListForScopeSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/examples/GetRoleAssignmentScheduleInstancesByScope.json + */ + /** + * Sample code: GetRoleAssignmentScheduleInstancesByScope. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleAssignmentScheduleInstancesByScope( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleAssignmentScheduleInstances() + .listForScope( + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "assignedTo('a3bb8764-cb92-4276-9d2a-ca1e895e55ea')", + com.azure.core.util.Context.NONE); + } +} +``` + +### RoleAssignmentScheduleRequests_Cancel + +```java +/** Samples for RoleAssignmentScheduleRequests Cancel. */ +public final class RoleAssignmentScheduleRequestsCancelSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-04-01-preview/examples/CancelRoleAssignmentScheduleRequestByName.json + */ + /** + * Sample code: CancelRoleAssignmentScheduleRequestByName. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void cancelRoleAssignmentScheduleRequestByName( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleAssignmentScheduleRequests() + .cancelWithResponse( + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "fea7a502-9a96-4806-a26f-eee560e52045", + com.azure.core.util.Context.NONE); + } +} +``` + +### RoleAssignmentScheduleRequests_Create + +```java +import com.azure.resourcemanager.authorization.generated.models.RequestType; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignmentScheduleRequestPropertiesScheduleInfo; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration; +import com.azure.resourcemanager.authorization.generated.models.Type; +import java.time.OffsetDateTime; + +/** Samples for RoleAssignmentScheduleRequests Create. */ +public final class RoleAssignmentScheduleRequestsCreateSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-04-01-preview/examples/PutRoleAssignmentScheduleRequest.json + */ + /** + * Sample code: PutRoleAssignmentScheduleRequest. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void putRoleAssignmentScheduleRequest( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleAssignmentScheduleRequests() + .define("fea7a502-9a96-4806-a26f-eee560e52045") + .withExistingScope("providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f") + .withRoleDefinitionId( + "/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f/providers/Microsoft.Authorization/roleDefinitions/c8d4ff99-41c3-41a8-9f60-21dfdad59608") + .withPrincipalId("a3bb8764-cb92-4276-9d2a-ca1e895e55ea") + .withRequestType(RequestType.SELF_ACTIVATE) + .withScheduleInfo( + new RoleAssignmentScheduleRequestPropertiesScheduleInfo() + .withStartDateTime(OffsetDateTime.parse("2020-09-09T21:35:27.91Z")) + .withExpiration( + new RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration() + .withType(Type.AFTER_DURATION) + .withDuration("PT8H"))) + .withLinkedRoleEligibilityScheduleId("b1477448-2cc6-4ceb-93b4-54a202a89413") + .withCondition( + "@Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName]" + + " StringEqualsIgnoreCase 'foo_storage_container'") + .withConditionVersion("1.0") + .create(); + } +} +``` + +### RoleAssignmentScheduleRequests_Get + +```java +/** Samples for RoleAssignmentScheduleRequests Get. */ +public final class RoleAssignmentScheduleRequestsGetSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-04-01-preview/examples/GetRoleAssignmentScheduleRequestByName.json + */ + /** + * Sample code: GetRoleAssignmentScheduleRequestByName. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleAssignmentScheduleRequestByName( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleAssignmentScheduleRequests() + .getWithResponse( + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "fea7a502-9a96-4806-a26f-eee560e52045", + com.azure.core.util.Context.NONE); + } +} +``` + +### RoleAssignmentScheduleRequests_ListForScope + +```java +/** Samples for RoleAssignmentScheduleRequests ListForScope. */ +public final class RoleAssignmentScheduleRequestsListForScopeSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-04-01-preview/examples/GetRoleAssignmentScheduleRequestByScope.json + */ + /** + * Sample code: GetRoleAssignmentScheduleRequestByScope. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleAssignmentScheduleRequestByScope( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleAssignmentScheduleRequests() + .listForScope( + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "assignedTo('A3BB8764-CB92-4276-9D2A-CA1E895E55EA')", + com.azure.core.util.Context.NONE); + } +} +``` + +### RoleAssignmentScheduleRequests_Validate + +```java +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleAssignmentScheduleRequestInner; +import com.azure.resourcemanager.authorization.generated.models.RequestType; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignmentScheduleRequestPropertiesScheduleInfo; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration; +import com.azure.resourcemanager.authorization.generated.models.Type; +import java.time.OffsetDateTime; + +/** Samples for RoleAssignmentScheduleRequests Validate. */ +public final class RoleAssignmentScheduleRequestsValidateSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-04-01-preview/examples/ValidateRoleAssignmentScheduleRequestByName.json + */ + /** + * Sample code: ValidateRoleAssignmentScheduleRequestByName. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void validateRoleAssignmentScheduleRequestByName( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleAssignmentScheduleRequests() + .validateWithResponse( + "subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "fea7a502-9a96-4806-a26f-eee560e52045", + new RoleAssignmentScheduleRequestInner() + .withRoleDefinitionId( + "/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f/providers/Microsoft.Authorization/roleDefinitions/c8d4ff99-41c3-41a8-9f60-21dfdad59608") + .withPrincipalId("a3bb8764-cb92-4276-9d2a-ca1e895e55ea") + .withRequestType(RequestType.SELF_ACTIVATE) + .withScheduleInfo( + new RoleAssignmentScheduleRequestPropertiesScheduleInfo() + .withStartDateTime(OffsetDateTime.parse("2020-09-09T21:35:27.91Z")) + .withExpiration( + new RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration() + .withType(Type.AFTER_DURATION) + .withDuration("PT8H"))) + .withLinkedRoleEligibilityScheduleId("b1477448-2cc6-4ceb-93b4-54a202a89413") + .withCondition( + "@Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName]" + + " StringEqualsIgnoreCase 'foo_storage_container'") + .withConditionVersion("1.0"), + com.azure.core.util.Context.NONE); + } +} +``` + +### RoleAssignmentSchedules_Get + +```java +/** Samples for RoleAssignmentSchedules Get. */ +public final class RoleAssignmentSchedulesGetSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/examples/GetRoleAssignmentScheduleByName.json + */ + /** + * Sample code: GetRoleAssignmentScheduleByName. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleAssignmentScheduleByName( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleAssignmentSchedules() + .getWithResponse( + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "c9e264ff-3133-4776-a81a-ebc7c33c8ec6", + com.azure.core.util.Context.NONE); + } +} +``` + +### RoleAssignmentSchedules_ListForScope + +```java +/** Samples for RoleAssignmentSchedules ListForScope. */ +public final class RoleAssignmentSchedulesListForScopeSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/examples/GetRoleAssignmentSchedulesByScope.json + */ + /** + * Sample code: GetRoleAssignmentSchedulesByScope. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleAssignmentSchedulesByScope( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleAssignmentSchedules() + .listForScope( + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "assignedTo('a3bb8764-cb92-4276-9d2a-ca1e895e55ea')", + com.azure.core.util.Context.NONE); + } +} +``` + +### RoleAssignments_Create + +```java +import com.azure.resourcemanager.authorization.generated.models.PrincipalType; + +/** Samples for RoleAssignments Create. */ +public final class RoleAssignmentsCreateSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/RoleAssignments_CreateForSubscription.json + */ + /** + * Sample code: Create role assignment for subscription. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void createRoleAssignmentForSubscription( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleAssignments() + .define("05c5a614-a7d6-4502-b150-c2fb455033ff") + .withExistingScope("subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2") + .withRoleDefinitionId( + "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d") + .withPrincipalId("ce2ce14e-85d7-4629-bdbc-454d0519d987") + .withPrincipalType(PrincipalType.USER) + .create(); + } + + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/RoleAssignments_CreateForResourceGroup.json + */ + /** + * Sample code: Create role assignment for resource group. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void createRoleAssignmentForResourceGroup( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleAssignments() + .define("05c5a614-a7d6-4502-b150-c2fb455033ff") + .withExistingScope("subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/resourceGroups/testrg") + .withRoleDefinitionId( + "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d") + .withPrincipalId("ce2ce14e-85d7-4629-bdbc-454d0519d987") + .withPrincipalType(PrincipalType.USER) + .create(); + } + + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/RoleAssignments_CreateForResource.json + */ + /** + * Sample code: Create role assignment for resource. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void createRoleAssignmentForResource( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleAssignments() + .define("05c5a614-a7d6-4502-b150-c2fb455033ff") + .withExistingScope( + "subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/resourceGroups/testrg/providers/Microsoft.DocumentDb/databaseAccounts/test-db-account") + .withRoleDefinitionId( + "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d") + .withPrincipalId("ce2ce14e-85d7-4629-bdbc-454d0519d987") + .withPrincipalType(PrincipalType.USER) + .create(); + } +} +``` + +### RoleAssignments_CreateById + +```java +import com.azure.resourcemanager.authorization.generated.models.PrincipalType; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignmentCreateParameters; + +/** Samples for RoleAssignments CreateById. */ +public final class RoleAssignmentsCreateByIdSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/RoleAssignments_CreateById.json + */ + /** + * Sample code: Create or update role assignment by ID. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void createOrUpdateRoleAssignmentByID( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleAssignments() + .createByIdWithResponse( + "subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleAssignments/b0f43c54-e787-4862-89b1-a653fa9cf747", + new RoleAssignmentCreateParameters() + .withRoleDefinitionId( + "/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d") + .withPrincipalId("ce2ce14e-85d7-4629-bdbc-454d0519d987") + .withPrincipalType(PrincipalType.USER), + com.azure.core.util.Context.NONE); + } +} +``` + +### RoleAssignments_Delete + +```java +/** Samples for RoleAssignments Delete. */ +public final class RoleAssignmentsDeleteSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/RoleAssignments_Delete.json + */ + /** + * Sample code: Delete role assignment. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void deleteRoleAssignment( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleAssignments() + .deleteWithResponse( + "subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2", + "b0f43c54-e787-4862-89b1-a653fa9cf747", + null, + com.azure.core.util.Context.NONE); + } +} +``` + +### RoleAssignments_DeleteById + +```java +/** Samples for RoleAssignments DeleteById. */ +public final class RoleAssignmentsDeleteByIdSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/RoleAssignments_DeleteById.json + */ + /** + * Sample code: Delete role assignment by ID. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void deleteRoleAssignmentByID( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleAssignments() + .deleteByIdWithResponse( + "subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleAssignments/b0f43c54-e787-4862-89b1-a653fa9cf747", + null, + com.azure.core.util.Context.NONE); + } +} +``` + +### RoleAssignments_Get + +```java +/** Samples for RoleAssignments Get. */ +public final class RoleAssignmentsGetSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/RoleAssignments_Get.json + */ + /** + * Sample code: Get role assignment by scope and name. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleAssignmentByScopeAndName( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleAssignments() + .getWithResponse( + "subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2", + "b0f43c54-e787-4862-89b1-a653fa9cf747", + null, + com.azure.core.util.Context.NONE); + } +} +``` + +### RoleAssignments_GetById + +```java +/** Samples for RoleAssignments GetById. */ +public final class RoleAssignmentsGetByIdSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/RoleAssignments_GetById.json + */ + /** + * Sample code: Get role assignment by ID. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleAssignmentByID( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleAssignments() + .getByIdWithResponse( + "subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleAssignments/b0f43c54-e787-4862-89b1-a653fa9cf747", + null, + com.azure.core.util.Context.NONE); + } +} +``` + +### RoleAssignments_List + +```java +/** Samples for RoleAssignments List. */ +public final class RoleAssignmentsListSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/RoleAssignments_ListForSubscription.json + */ + /** + * Sample code: List role assignments for subscription. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void listRoleAssignmentsForSubscription( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager.roleAssignments().list(null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### RoleAssignments_ListByResourceGroup + +```java +/** Samples for RoleAssignments ListByResourceGroup. */ +public final class RoleAssignmentsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/RoleAssignments_ListForResourceGroup.json + */ + /** + * Sample code: List role assignments for resource group. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void listRoleAssignmentsForResourceGroup( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager.roleAssignments().listByResourceGroup("testrg", null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### RoleAssignments_ListForResource + +```java +/** Samples for RoleAssignments ListForResource. */ +public final class RoleAssignmentsListForResourceSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/RoleAssignments_ListForResource.json + */ + /** + * Sample code: List role assignments for a resource. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void listRoleAssignmentsForAResource( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleAssignments() + .listForResource( + "testrg", + "Microsoft.DocumentDb", + "databaseAccounts", + "test-db-account", + null, + null, + com.azure.core.util.Context.NONE); + } +} +``` + +### RoleAssignments_ListForScope + +```java +/** Samples for RoleAssignments ListForScope. */ +public final class RoleAssignmentsListForScopeSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/RoleAssignments_ListForScope.json + */ + /** + * Sample code: List role assignments for scope. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void listRoleAssignmentsForScope( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleAssignments() + .listForScope( + "subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2", + null, + null, + null, + com.azure.core.util.Context.NONE); + } +} +``` + +### RoleDefinitions_CreateOrUpdate + +```java +/** Samples for RoleDefinitions CreateOrUpdate. */ +public final class RoleDefinitionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-05-01-preview/examples/PutRoleDefinition.json + */ + /** + * Sample code: Create role definition. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void createRoleDefinition( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager.roleDefinitions().define("roleDefinitionId").withExistingScope("scope").create(); + } +} +``` + +### RoleDefinitions_Delete + +```java +/** Samples for RoleDefinitions Delete. */ +public final class RoleDefinitionsDeleteSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-05-01-preview/examples/DeleteRoleDefinition.json + */ + /** + * Sample code: Delete role definition. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void deleteRoleDefinition( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleDefinitions() + .deleteByResourceGroupWithResponse("scope", "roleDefinitionId", com.azure.core.util.Context.NONE); + } +} +``` + +### RoleDefinitions_Get + +```java +/** Samples for RoleDefinitions Get. */ +public final class RoleDefinitionsGetSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-05-01-preview/examples/GetRoleDefinitionById.json + */ + /** + * Sample code: Get role definition by id. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleDefinitionById( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager.roleDefinitions().getWithResponse("scope", "roleDefinitionId", com.azure.core.util.Context.NONE); + } +} +``` + +### RoleDefinitions_GetById + +```java +/** Samples for RoleDefinitions GetById. */ +public final class RoleDefinitionsGetByIdSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-05-01-preview/examples/GetRoleDefinitionByRoleId.json + */ + /** + * Sample code: Get role definition by role ID. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleDefinitionByRoleID( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager.roleDefinitions().getByIdWithResponse("roleDefinitionId", com.azure.core.util.Context.NONE); + } +} +``` + +### RoleDefinitions_List + +```java +/** Samples for RoleDefinitions List. */ +public final class RoleDefinitionsListSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-05-01-preview/examples/GetRoleDefinitionAtScope.json + */ + /** + * Sample code: List role definitions for scope. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void listRoleDefinitionsForScope( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager.roleDefinitions().list("scope", null, com.azure.core.util.Context.NONE); + } +} +``` + +### RoleEligibilityScheduleInstances_Get + +```java +/** Samples for RoleEligibilityScheduleInstances Get. */ +public final class RoleEligibilityScheduleInstancesGetSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/examples/GetRoleEligibilityScheduleInstanceByName.json + */ + /** + * Sample code: GetRoleEligibilityScheduleInstanceByName. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleEligibilityScheduleInstanceByName( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleEligibilityScheduleInstances() + .getWithResponse( + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "21e4b59a-0499-4fe0-a3c3-43a3055b773a", + com.azure.core.util.Context.NONE); + } +} +``` + +### RoleEligibilityScheduleInstances_ListForScope + +```java +/** Samples for RoleEligibilityScheduleInstances ListForScope. */ +public final class RoleEligibilityScheduleInstancesListForScopeSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/examples/GetRoleEligibilityScheduleInstancesByScope.json + */ + /** + * Sample code: GetRoleEligibilityScheduleInstancesByScope. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleEligibilityScheduleInstancesByScope( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleEligibilityScheduleInstances() + .listForScope( + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "assignedTo('a3bb8764-cb92-4276-9d2a-ca1e895e55ea')", + com.azure.core.util.Context.NONE); + } +} +``` + +### RoleEligibilityScheduleRequests_Cancel + +```java +/** Samples for RoleEligibilityScheduleRequests Cancel. */ +public final class RoleEligibilityScheduleRequestsCancelSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-04-01-preview/examples/CancelRoleEligibilityScheduleRequestByName.json + */ + /** + * Sample code: CancelRoleEligibilityScheduleRequestByName. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void cancelRoleEligibilityScheduleRequestByName( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleEligibilityScheduleRequests() + .cancelWithResponse( + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "64caffb6-55c0-4deb-a585-68e948ea1ad6", + com.azure.core.util.Context.NONE); + } +} +``` + +### RoleEligibilityScheduleRequests_Create + +```java +import com.azure.resourcemanager.authorization.generated.models.RequestType; +import com.azure.resourcemanager.authorization.generated.models.RoleEligibilityScheduleRequestPropertiesScheduleInfo; +import com.azure.resourcemanager.authorization.generated.models.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration; +import com.azure.resourcemanager.authorization.generated.models.Type; +import java.time.OffsetDateTime; + +/** Samples for RoleEligibilityScheduleRequests Create. */ +public final class RoleEligibilityScheduleRequestsCreateSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-04-01-preview/examples/PutRoleEligibilityScheduleRequest.json + */ + /** + * Sample code: PutRoleEligibilityScheduleRequest. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void putRoleEligibilityScheduleRequest( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleEligibilityScheduleRequests() + .define("64caffb6-55c0-4deb-a585-68e948ea1ad6") + .withExistingScope("providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f") + .withRoleDefinitionId( + "/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f/providers/Microsoft.Authorization/roleDefinitions/c8d4ff99-41c3-41a8-9f60-21dfdad59608") + .withPrincipalId("a3bb8764-cb92-4276-9d2a-ca1e895e55ea") + .withRequestType(RequestType.ADMIN_ASSIGN) + .withScheduleInfo( + new RoleEligibilityScheduleRequestPropertiesScheduleInfo() + .withStartDateTime(OffsetDateTime.parse("2020-09-09T21:31:27.91Z")) + .withExpiration( + new RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration() + .withType(Type.AFTER_DURATION) + .withDuration("P365D"))) + .withCondition( + "@Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName]" + + " StringEqualsIgnoreCase 'foo_storage_container'") + .withConditionVersion("1.0") + .create(); + } +} +``` + +### RoleEligibilityScheduleRequests_Get + +```java +/** Samples for RoleEligibilityScheduleRequests Get. */ +public final class RoleEligibilityScheduleRequestsGetSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-04-01-preview/examples/GetRoleEligibilityScheduleRequestByName.json + */ + /** + * Sample code: GetRoleEligibilityScheduleRequestByName. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleEligibilityScheduleRequestByName( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleEligibilityScheduleRequests() + .getWithResponse( + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "64caffb6-55c0-4deb-a585-68e948ea1ad6", + com.azure.core.util.Context.NONE); + } +} +``` + +### RoleEligibilityScheduleRequests_ListForScope + +```java +/** Samples for RoleEligibilityScheduleRequests ListForScope. */ +public final class RoleEligibilityScheduleRequestsListForScopeSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-04-01-preview/examples/GetRoleEligibilityScheduleRequestByScope.json + */ + /** + * Sample code: GetRoleEligibilityScheduleRequestByScope. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleEligibilityScheduleRequestByScope( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleEligibilityScheduleRequests() + .listForScope( + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "assignedTo('A3BB8764-CB92-4276-9D2A-CA1E895E55EA')", + com.azure.core.util.Context.NONE); + } +} +``` + +### RoleEligibilityScheduleRequests_Validate + +```java +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleEligibilityScheduleRequestInner; +import com.azure.resourcemanager.authorization.generated.models.RequestType; +import com.azure.resourcemanager.authorization.generated.models.RoleEligibilityScheduleRequestPropertiesScheduleInfo; +import com.azure.resourcemanager.authorization.generated.models.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration; +import com.azure.resourcemanager.authorization.generated.models.Type; +import java.time.OffsetDateTime; + +/** Samples for RoleEligibilityScheduleRequests Validate. */ +public final class RoleEligibilityScheduleRequestsValidateSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-04-01-preview/examples/ValidateRoleEligibilityScheduleRequestByName.json + */ + /** + * Sample code: ValidateRoleEligibilityScheduleRequestByName. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void validateRoleEligibilityScheduleRequestByName( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleEligibilityScheduleRequests() + .validateWithResponse( + "subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "64caffb6-55c0-4deb-a585-68e948ea1ad6", + new RoleEligibilityScheduleRequestInner() + .withRoleDefinitionId( + "/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f/providers/Microsoft.Authorization/roleDefinitions/c8d4ff99-41c3-41a8-9f60-21dfdad59608") + .withPrincipalId("a3bb8764-cb92-4276-9d2a-ca1e895e55ea") + .withRequestType(RequestType.ADMIN_ASSIGN) + .withScheduleInfo( + new RoleEligibilityScheduleRequestPropertiesScheduleInfo() + .withStartDateTime(OffsetDateTime.parse("2020-09-09T21:31:27.91Z")) + .withExpiration( + new RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration() + .withType(Type.AFTER_DURATION) + .withDuration("P365D"))) + .withCondition( + "@Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName]" + + " StringEqualsIgnoreCase 'foo_storage_container'") + .withConditionVersion("1.0"), + com.azure.core.util.Context.NONE); + } +} +``` + +### RoleEligibilitySchedules_Get + +```java +/** Samples for RoleEligibilitySchedules Get. */ +public final class RoleEligibilitySchedulesGetSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/examples/GetRoleEligibilityScheduleByName.json + */ + /** + * Sample code: GetRoleEligibilityScheduleByName. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleEligibilityScheduleByName( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleEligibilitySchedules() + .getWithResponse( + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "b1477448-2cc6-4ceb-93b4-54a202a89413", + com.azure.core.util.Context.NONE); + } +} +``` + +### RoleEligibilitySchedules_ListForScope + +```java +/** Samples for RoleEligibilitySchedules ListForScope. */ +public final class RoleEligibilitySchedulesListForScopeSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/examples/GetRoleEligibilitySchedulesByScope.json + */ + /** + * Sample code: GetRoleEligibilitySchedulesByScope. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleEligibilitySchedulesByScope( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleEligibilitySchedules() + .listForScope( + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "assignedTo('a3bb8764-cb92-4276-9d2a-ca1e895e55ea')", + com.azure.core.util.Context.NONE); + } +} +``` + +### RoleManagementPolicies_Delete + +```java +/** Samples for RoleManagementPolicies Delete. */ +public final class RoleManagementPoliciesDeleteSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/examples/DeleteRoleManagementPolicy.json + */ + /** + * Sample code: DeleteRoleManagementPolicy. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void deleteRoleManagementPolicy( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleManagementPolicies() + .deleteByResourceGroupWithResponse( + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368", + "570c3619-7688-4b34-b290-2b8bb3ccab2a", + com.azure.core.util.Context.NONE); + } +} +``` + +### RoleManagementPolicies_Get + +```java +/** Samples for RoleManagementPolicies Get. */ +public final class RoleManagementPoliciesGetSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/examples/GetRoleManagementPolicyByName.json + */ + /** + * Sample code: GetRoleManagementPolicyByName. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleManagementPolicyByName( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleManagementPolicies() + .getWithResponse( + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368", + "570c3619-7688-4b34-b290-2b8bb3ccab2a", + com.azure.core.util.Context.NONE); + } +} +``` + +### RoleManagementPolicies_ListForScope + +```java +/** Samples for RoleManagementPolicies ListForScope. */ +public final class RoleManagementPoliciesListForScopeSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/examples/GetRoleManagementPolicyByScope.json + */ + /** + * Sample code: GetRoleManagementPolicyByRoleDefinitionFilter. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleManagementPolicyByRoleDefinitionFilter( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleManagementPolicies() + .listForScope( + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368", + com.azure.core.util.Context.NONE); + } +} +``` + +### RoleManagementPolicies_Update + +```java +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleManagementPolicyInner; +import com.azure.resourcemanager.authorization.generated.models.ApprovalMode; +import com.azure.resourcemanager.authorization.generated.models.ApprovalSettings; +import com.azure.resourcemanager.authorization.generated.models.ApprovalStage; +import com.azure.resourcemanager.authorization.generated.models.EnablementRules; +import com.azure.resourcemanager.authorization.generated.models.NotificationDeliveryMechanism; +import com.azure.resourcemanager.authorization.generated.models.NotificationLevel; +import com.azure.resourcemanager.authorization.generated.models.RecipientType; +import com.azure.resourcemanager.authorization.generated.models.RoleManagementPolicyApprovalRule; +import com.azure.resourcemanager.authorization.generated.models.RoleManagementPolicyAuthenticationContextRule; +import com.azure.resourcemanager.authorization.generated.models.RoleManagementPolicyEnablementRule; +import com.azure.resourcemanager.authorization.generated.models.RoleManagementPolicyExpirationRule; +import com.azure.resourcemanager.authorization.generated.models.RoleManagementPolicyNotificationRule; +import com.azure.resourcemanager.authorization.generated.models.RoleManagementPolicyRuleTarget; +import com.azure.resourcemanager.authorization.generated.models.UserSet; +import com.azure.resourcemanager.authorization.generated.models.UserType; +import java.util.Arrays; + +/** Samples for RoleManagementPolicies Update. */ +public final class RoleManagementPoliciesUpdateSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/examples/PatchPartialRoleManagementPolicy.json + */ + /** + * Sample code: PatchPartialRoleManagementPolicy. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void patchPartialRoleManagementPolicy( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleManagementPolicies() + .updateWithResponse( + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368", + "570c3619-7688-4b34-b290-2b8bb3ccab2a", + new RoleManagementPolicyInner() + .withRules( + Arrays + .asList( + new RoleManagementPolicyExpirationRule() + .withId("Expiration_Admin_Eligibility") + .withTarget( + new RoleManagementPolicyRuleTarget() + .withCaller("Admin") + .withOperations(Arrays.asList("All")) + .withLevel("Eligibility")) + .withIsExpirationRequired(false) + .withMaximumDuration("P180D"), + new RoleManagementPolicyNotificationRule() + .withId("Notification_Admin_Admin_Eligibility") + .withTarget( + new RoleManagementPolicyRuleTarget() + .withCaller("Admin") + .withOperations(Arrays.asList("All")) + .withLevel("Eligibility")) + .withNotificationType(NotificationDeliveryMechanism.EMAIL) + .withNotificationLevel(NotificationLevel.CRITICAL) + .withRecipientType(RecipientType.ADMIN) + .withNotificationRecipients(Arrays.asList("admin_admin_eligible@test.com")) + .withIsDefaultRecipientsEnabled(false))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/examples/PatchRoleManagementPolicy.json + */ + /** + * Sample code: PatchRoleManagementPolicy. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void patchRoleManagementPolicy( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleManagementPolicies() + .updateWithResponse( + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368", + "570c3619-7688-4b34-b290-2b8bb3ccab2a", + new RoleManagementPolicyInner() + .withRules( + Arrays + .asList( + new RoleManagementPolicyExpirationRule() + .withId("Expiration_Admin_Eligibility") + .withTarget( + new RoleManagementPolicyRuleTarget() + .withCaller("Admin") + .withOperations(Arrays.asList("All")) + .withLevel("Eligibility")) + .withIsExpirationRequired(false) + .withMaximumDuration("P180D"), + new RoleManagementPolicyNotificationRule() + .withId("Notification_Admin_Admin_Eligibility") + .withTarget( + new RoleManagementPolicyRuleTarget() + .withCaller("Admin") + .withOperations(Arrays.asList("All")) + .withLevel("Eligibility")) + .withNotificationType(NotificationDeliveryMechanism.EMAIL) + .withNotificationLevel(NotificationLevel.CRITICAL) + .withRecipientType(RecipientType.ADMIN) + .withNotificationRecipients(Arrays.asList("admin_admin_eligible@test.com")) + .withIsDefaultRecipientsEnabled(false), + new RoleManagementPolicyNotificationRule() + .withId("Notification_Requestor_Admin_Eligibility") + .withTarget( + new RoleManagementPolicyRuleTarget() + .withCaller("Admin") + .withOperations(Arrays.asList("All")) + .withLevel("Eligibility")) + .withNotificationType(NotificationDeliveryMechanism.EMAIL) + .withNotificationLevel(NotificationLevel.CRITICAL) + .withRecipientType(RecipientType.REQUESTOR) + .withNotificationRecipients(Arrays.asList("requestor_admin_eligible@test.com")) + .withIsDefaultRecipientsEnabled(false), + new RoleManagementPolicyNotificationRule() + .withId("Notification_Approver_Admin_Eligibility") + .withTarget( + new RoleManagementPolicyRuleTarget() + .withCaller("Admin") + .withOperations(Arrays.asList("All")) + .withLevel("Eligibility")) + .withNotificationType(NotificationDeliveryMechanism.EMAIL) + .withNotificationLevel(NotificationLevel.CRITICAL) + .withRecipientType(RecipientType.APPROVER) + .withNotificationRecipients(Arrays.asList("approver_admin_eligible@test.com")) + .withIsDefaultRecipientsEnabled(false), + new RoleManagementPolicyEnablementRule() + .withId("Enablement_Admin_Eligibility") + .withTarget( + new RoleManagementPolicyRuleTarget() + .withCaller("Admin") + .withOperations(Arrays.asList("All")) + .withLevel("Eligibility")) + .withEnabledRules(Arrays.asList()), + new RoleManagementPolicyExpirationRule() + .withId("Expiration_Admin_Assignment") + .withTarget( + new RoleManagementPolicyRuleTarget() + .withCaller("Admin") + .withOperations(Arrays.asList("All")) + .withLevel("Assignment")) + .withIsExpirationRequired(false) + .withMaximumDuration("P90D"), + new RoleManagementPolicyEnablementRule() + .withId("Enablement_Admin_Assignment") + .withTarget( + new RoleManagementPolicyRuleTarget() + .withCaller("Admin") + .withOperations(Arrays.asList("All")) + .withLevel("Assignment")) + .withEnabledRules( + Arrays + .asList( + EnablementRules.JUSTIFICATION, + EnablementRules.MULTI_FACTOR_AUTHENTICATION)), + new RoleManagementPolicyNotificationRule() + .withId("Notification_Admin_Admin_Assignment") + .withTarget( + new RoleManagementPolicyRuleTarget() + .withCaller("Admin") + .withOperations(Arrays.asList("All")) + .withLevel("Assignment")) + .withNotificationType(NotificationDeliveryMechanism.EMAIL) + .withNotificationLevel(NotificationLevel.CRITICAL) + .withRecipientType(RecipientType.ADMIN) + .withNotificationRecipients(Arrays.asList("admin_admin_member@test.com")) + .withIsDefaultRecipientsEnabled(false), + new RoleManagementPolicyNotificationRule() + .withId("Notification_Requestor_Admin_Assignment") + .withTarget( + new RoleManagementPolicyRuleTarget() + .withCaller("Admin") + .withOperations(Arrays.asList("All")) + .withLevel("Assignment")) + .withNotificationType(NotificationDeliveryMechanism.EMAIL) + .withNotificationLevel(NotificationLevel.CRITICAL) + .withRecipientType(RecipientType.REQUESTOR) + .withNotificationRecipients(Arrays.asList("requestor_admin_member@test.com")) + .withIsDefaultRecipientsEnabled(false), + new RoleManagementPolicyNotificationRule() + .withId("Notification_Approver_Admin_Assignment") + .withTarget( + new RoleManagementPolicyRuleTarget() + .withCaller("Admin") + .withOperations(Arrays.asList("All")) + .withLevel("Assignment")) + .withNotificationType(NotificationDeliveryMechanism.EMAIL) + .withNotificationLevel(NotificationLevel.CRITICAL) + .withRecipientType(RecipientType.APPROVER) + .withNotificationRecipients(Arrays.asList("approver_admin_member@test.com")) + .withIsDefaultRecipientsEnabled(false), + new RoleManagementPolicyExpirationRule() + .withId("Expiration_EndUser_Assignment") + .withTarget( + new RoleManagementPolicyRuleTarget() + .withCaller("EndUser") + .withOperations(Arrays.asList("All")) + .withLevel("Assignment")) + .withIsExpirationRequired(true) + .withMaximumDuration("PT7H"), + new RoleManagementPolicyEnablementRule() + .withId("Enablement_EndUser_Assignment") + .withTarget( + new RoleManagementPolicyRuleTarget() + .withCaller("EndUser") + .withOperations(Arrays.asList("All")) + .withLevel("Assignment")) + .withEnabledRules( + Arrays + .asList( + EnablementRules.JUSTIFICATION, + EnablementRules.MULTI_FACTOR_AUTHENTICATION, + EnablementRules.TICKETING)), + new RoleManagementPolicyApprovalRule() + .withId("Approval_EndUser_Assignment") + .withTarget( + new RoleManagementPolicyRuleTarget() + .withCaller("EndUser") + .withOperations(Arrays.asList("All")) + .withLevel("Assignment")) + .withSetting( + new ApprovalSettings() + .withIsApprovalRequired(true) + .withIsApprovalRequiredForExtension(false) + .withIsRequestorJustificationRequired(true) + .withApprovalMode(ApprovalMode.SINGLE_STAGE) + .withApprovalStages( + Arrays + .asList( + new ApprovalStage() + .withApprovalStageTimeOutInDays(1) + .withIsApproverJustificationRequired(true) + .withEscalationTimeInMinutes(0) + .withPrimaryApprovers( + Arrays + .asList( + new UserSet() + .withUserType(UserType.GROUP) + .withIsBackup(false) + .withId( + "2385b0f3-5fa9-43cf-8ca4-b01dc97298cd") + .withDescription("amansw_new_group"), + new UserSet() + .withUserType(UserType.GROUP) + .withIsBackup(false) + .withId( + "2f4913c9-d15b-406a-9946-1d66a28f2690") + .withDescription("amansw_group"))) + .withIsEscalationEnabled(false)))), + new RoleManagementPolicyAuthenticationContextRule() + .withId("AuthenticationContext_EndUser_Assignment") + .withTarget( + new RoleManagementPolicyRuleTarget() + .withCaller("EndUser") + .withOperations(Arrays.asList("All")) + .withLevel("Assignment")) + .withIsEnabled(false) + .withClaimValue(""), + new RoleManagementPolicyNotificationRule() + .withId("Notification_Admin_EndUser_Assignment") + .withTarget( + new RoleManagementPolicyRuleTarget() + .withCaller("EndUser") + .withOperations(Arrays.asList("All")) + .withLevel("Assignment")) + .withNotificationType(NotificationDeliveryMechanism.EMAIL) + .withNotificationLevel(NotificationLevel.CRITICAL) + .withRecipientType(RecipientType.ADMIN) + .withNotificationRecipients(Arrays.asList("admin_enduser_member@test.com")) + .withIsDefaultRecipientsEnabled(false), + new RoleManagementPolicyNotificationRule() + .withId("Notification_Requestor_EndUser_Assignment") + .withTarget( + new RoleManagementPolicyRuleTarget() + .withCaller("EndUser") + .withOperations(Arrays.asList("All")) + .withLevel("Assignment")) + .withNotificationType(NotificationDeliveryMechanism.EMAIL) + .withNotificationLevel(NotificationLevel.CRITICAL) + .withRecipientType(RecipientType.REQUESTOR) + .withNotificationRecipients(Arrays.asList("requestor_enduser_member@test.com")) + .withIsDefaultRecipientsEnabled(false), + new RoleManagementPolicyNotificationRule() + .withId("Notification_Approver_EndUser_Assignment") + .withTarget( + new RoleManagementPolicyRuleTarget() + .withCaller("EndUser") + .withOperations(Arrays.asList("All")) + .withLevel("Assignment")) + .withNotificationType(NotificationDeliveryMechanism.EMAIL) + .withNotificationLevel(NotificationLevel.CRITICAL) + .withRecipientType(RecipientType.APPROVER) + .withIsDefaultRecipientsEnabled(true))), + com.azure.core.util.Context.NONE); + } +} +``` + +### RoleManagementPolicyAssignments_Create + +```java +/** Samples for RoleManagementPolicyAssignments Create. */ +public final class RoleManagementPolicyAssignmentsCreateSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/examples/PutRoleManagementPolicyAssignment.json + */ + /** + * Sample code: PutRoleManagementPolicyAssignment. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void putRoleManagementPolicyAssignment( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleManagementPolicyAssignments() + .define("b959d571-f0b5-4042-88a7-01be6cb22db9_a1705bd2-3a8f-45a5-8683-466fcfd5cc24") + .withExistingScope("providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368") + .withScope("/subscriptions/129ff972-28f8-46b8-a726-e497be039368") + .withRoleDefinitionId( + "/subscriptions/129ff972-28f8-46b8-a726-e497be039368/providers/Microsoft.Authorization/roleDefinitions/a1705bd2-3a8f-45a5-8683-466fcfd5cc24") + .withPolicyId( + "/providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368/providers/Microsoft.Authorization/roleManagementPolicies/b959d571-f0b5-4042-88a7-01be6cb22db9") + .create(); + } +} +``` + +### RoleManagementPolicyAssignments_Delete + +```java +/** Samples for RoleManagementPolicyAssignments Delete. */ +public final class RoleManagementPolicyAssignmentsDeleteSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/examples/DeleteRoleManagementPolicyAssignment.json + */ + /** + * Sample code: DeleteRoleManagementPolicyAssignment. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void deleteRoleManagementPolicyAssignment( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleManagementPolicyAssignments() + .deleteByResourceGroupWithResponse( + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368", + "b959d571-f0b5-4042-88a7-01be6cb22db9_a1705bd2-3a8f-45a5-8683-466fcfd5cc24", + com.azure.core.util.Context.NONE); + } +} +``` + +### RoleManagementPolicyAssignments_Get + +```java +/** Samples for RoleManagementPolicyAssignments Get. */ +public final class RoleManagementPolicyAssignmentsGetSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/examples/GetRoleManagementPolicyAssignmentByName.json + */ + /** + * Sample code: GetConfigurations. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getConfigurations( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleManagementPolicyAssignments() + .getWithResponse( + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368", + "b959d571-f0b5-4042-88a7-01be6cb22db9_a1705bd2-3a8f-45a5-8683-466fcfd5cc24", + com.azure.core.util.Context.NONE); + } +} +``` + +### RoleManagementPolicyAssignments_ListForScope + +```java +/** Samples for RoleManagementPolicyAssignments ListForScope. */ +public final class RoleManagementPolicyAssignmentsListForScopeSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/examples/GetRoleManagementPolicyAssignmentByScope.json + */ + /** + * Sample code: GetRoleManagementPolicyAssignmentByScope. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleManagementPolicyAssignmentByScope( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleManagementPolicyAssignments() + .listForScope( + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368", + com.azure.core.util.Context.NONE); + } +} +``` + +### ScopeAccessReviewDefaultSettings_Get + +```java +/** 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", com.azure.core.util.Context.NONE); + } +} +``` + +### ScopeAccessReviewDefaultSettings_Put + +```java +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(), + com.azure.core.util.Context.NONE); + } +} +``` + +### ScopeAccessReviewHistoryDefinitionInstance_GenerateDownloadUri + +```java +/** 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", + com.azure.core.util.Context.NONE); + } +} +``` + +### ScopeAccessReviewHistoryDefinitionInstancesOperation_List + +```java +/** 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", + com.azure.core.util.Context.NONE); + } +} +``` + +### ScopeAccessReviewHistoryDefinitionOperation_Create + +```java +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(), + com.azure.core.util.Context.NONE); + } +} +``` + +### ScopeAccessReviewHistoryDefinitionOperation_DeleteById + +```java +/** 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", + com.azure.core.util.Context.NONE); + } +} +``` + +### ScopeAccessReviewHistoryDefinitions_GetById + +```java +/** 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", + com.azure.core.util.Context.NONE); + } +} +``` + +### ScopeAccessReviewHistoryDefinitions_List + +```java +/** 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, com.azure.core.util.Context.NONE); + } +} +``` + +### ScopeAccessReviewInstanceContactedReviewers_List + +```java +/** 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", + com.azure.core.util.Context.NONE); + } +} +``` + +### ScopeAccessReviewInstanceDecisions_List + +```java +/** 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, + com.azure.core.util.Context.NONE); + } +} +``` + +### ScopeAccessReviewInstanceOperation_ApplyDecisions + +```java +/** 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", + com.azure.core.util.Context.NONE); + } +} +``` + +### ScopeAccessReviewInstanceOperation_RecordAllDecisions + +```java +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(), + com.azure.core.util.Context.NONE); + } +} +``` + +### ScopeAccessReviewInstanceOperation_ResetDecisions + +```java +/** 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", + com.azure.core.util.Context.NONE); + } +} +``` + +### ScopeAccessReviewInstanceOperation_SendReminders + +```java +/** 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", + com.azure.core.util.Context.NONE); + } +} +``` + +### ScopeAccessReviewInstanceOperation_Stop + +```java +/** 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", + com.azure.core.util.Context.NONE); + } +} +``` + +### ScopeAccessReviewInstances_Create + +```java +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(), + com.azure.core.util.Context.NONE); + } +} +``` + +### ScopeAccessReviewInstances_GetById + +```java +/** 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", + com.azure.core.util.Context.NONE); + } +} +``` + +### ScopeAccessReviewInstances_List + +```java +/** 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, + com.azure.core.util.Context.NONE); + } +} +``` + +### ScopeAccessReviewScheduleDefinitions_CreateOrUpdateById + +```java +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(), + com.azure.core.util.Context.NONE); + } +} +``` + +### ScopeAccessReviewScheduleDefinitions_DeleteById + +```java +/** 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", + com.azure.core.util.Context.NONE); + } +} +``` + +### ScopeAccessReviewScheduleDefinitions_GetById + +```java +/** 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", + com.azure.core.util.Context.NONE); + } +} +``` + +### ScopeAccessReviewScheduleDefinitions_List + +```java +/** 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, com.azure.core.util.Context.NONE); + } +} +``` + +### ScopeAccessReviewScheduleDefinitions_Stop + +```java +/** 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", + com.azure.core.util.Context.NONE); + } +} +``` + +### TenantLevelAccessReviewInstanceContactedReviewers_List + +```java +/** 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", + com.azure.core.util.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 000000000000..e9d2938d2527 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/pom.xml @@ -0,0 +1,61 @@ + + + 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. Role based access control provides you a way to apply granular level policy administration down to individual resources or resource groups. These operations enable you to manage role definitions and role assignments. A role definition describes the set of actions that can be performed on resources. A role assignment grants access to Azure Active Directory users. Package tag package-2022-05-01-preview. + 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 + 0 + 0 + + + + com.azure + azure-core + 1.41.0 + + + com.azure + azure-core-management + 1.11.3 + + + 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 000000000000..664020e00735 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/AuthorizationManager.java @@ -0,0 +1,1058 @@ +// 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.AlertConfigurationsImpl; +import com.azure.resourcemanager.authorization.generated.implementation.AlertDefinitionsImpl; +import com.azure.resourcemanager.authorization.generated.implementation.AlertIncidentsImpl; +import com.azure.resourcemanager.authorization.generated.implementation.AlertOperationsImpl; +import com.azure.resourcemanager.authorization.generated.implementation.AlertsImpl; +import com.azure.resourcemanager.authorization.generated.implementation.AuthorizationManagementClientBuilder; +import com.azure.resourcemanager.authorization.generated.implementation.ClassicAdministratorsImpl; +import com.azure.resourcemanager.authorization.generated.implementation.DenyAssignmentsImpl; +import com.azure.resourcemanager.authorization.generated.implementation.EligibleChildResourcesImpl; +import com.azure.resourcemanager.authorization.generated.implementation.GlobalAdministratorsImpl; +import com.azure.resourcemanager.authorization.generated.implementation.OperationsImpl; +import com.azure.resourcemanager.authorization.generated.implementation.PermissionsImpl; +import com.azure.resourcemanager.authorization.generated.implementation.ProviderOperationsMetadatasImpl; +import com.azure.resourcemanager.authorization.generated.implementation.RoleAssignmentScheduleInstancesImpl; +import com.azure.resourcemanager.authorization.generated.implementation.RoleAssignmentScheduleRequestsImpl; +import com.azure.resourcemanager.authorization.generated.implementation.RoleAssignmentSchedulesImpl; +import com.azure.resourcemanager.authorization.generated.implementation.RoleAssignmentsImpl; +import com.azure.resourcemanager.authorization.generated.implementation.RoleDefinitionsImpl; +import com.azure.resourcemanager.authorization.generated.implementation.RoleEligibilityScheduleInstancesImpl; +import com.azure.resourcemanager.authorization.generated.implementation.RoleEligibilityScheduleRequestsImpl; +import com.azure.resourcemanager.authorization.generated.implementation.RoleEligibilitySchedulesImpl; +import com.azure.resourcemanager.authorization.generated.implementation.RoleManagementPoliciesImpl; +import com.azure.resourcemanager.authorization.generated.implementation.RoleManagementPolicyAssignmentsImpl; +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.AlertConfigurations; +import com.azure.resourcemanager.authorization.generated.models.AlertDefinitions; +import com.azure.resourcemanager.authorization.generated.models.AlertIncidents; +import com.azure.resourcemanager.authorization.generated.models.AlertOperations; +import com.azure.resourcemanager.authorization.generated.models.Alerts; +import com.azure.resourcemanager.authorization.generated.models.ClassicAdministrators; +import com.azure.resourcemanager.authorization.generated.models.DenyAssignments; +import com.azure.resourcemanager.authorization.generated.models.EligibleChildResources; +import com.azure.resourcemanager.authorization.generated.models.GlobalAdministrators; +import com.azure.resourcemanager.authorization.generated.models.Operations; +import com.azure.resourcemanager.authorization.generated.models.Permissions; +import com.azure.resourcemanager.authorization.generated.models.ProviderOperationsMetadatas; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignmentScheduleInstances; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignmentScheduleRequests; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignmentSchedules; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignments; +import com.azure.resourcemanager.authorization.generated.models.RoleDefinitions; +import com.azure.resourcemanager.authorization.generated.models.RoleEligibilityScheduleInstances; +import com.azure.resourcemanager.authorization.generated.models.RoleEligibilityScheduleRequests; +import com.azure.resourcemanager.authorization.generated.models.RoleEligibilitySchedules; +import com.azure.resourcemanager.authorization.generated.models.RoleManagementPolicies; +import com.azure.resourcemanager.authorization.generated.models.RoleManagementPolicyAssignments; +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. Role based access control provides you a way to apply granular level policy + * administration down to individual resources or resource groups. These operations enable you to manage role + * definitions and role assignments. A role definition describes the set of actions that can be performed on resources. + * A role assignment grants access to Azure Active Directory users. + */ +public final class AuthorizationManager { + private ClassicAdministrators classicAdministrators; + + private GlobalAdministrators globalAdministrators; + + private DenyAssignments denyAssignments; + + private ProviderOperationsMetadatas providerOperationsMetadatas; + + private RoleAssignments roleAssignments; + + private Permissions permissions; + + private RoleDefinitions roleDefinitions; + + 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 EligibleChildResources eligibleChildResources; + + private RoleAssignmentSchedules roleAssignmentSchedules; + + private RoleAssignmentScheduleInstances roleAssignmentScheduleInstances; + + private RoleAssignmentScheduleRequests roleAssignmentScheduleRequests; + + private RoleEligibilitySchedules roleEligibilitySchedules; + + private RoleEligibilityScheduleInstances roleEligibilityScheduleInstances; + + private RoleEligibilityScheduleRequests roleEligibilityScheduleRequests; + + private RoleManagementPolicies roleManagementPolicies; + + private RoleManagementPolicyAssignments roleManagementPolicyAssignments; + + private Alerts alerts; + + private AlertConfigurations alertConfigurations; + + private AlertDefinitions alertDefinitions; + + private AlertIncidents alertIncidents; + + private AlertOperations alertOperations; + + 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 ClassicAdministrators. + * + * @return Resource collection API of ClassicAdministrators. + */ + public ClassicAdministrators classicAdministrators() { + if (this.classicAdministrators == null) { + this.classicAdministrators = new ClassicAdministratorsImpl(clientObject.getClassicAdministrators(), this); + } + return classicAdministrators; + } + + /** + * Gets the resource collection API of GlobalAdministrators. + * + * @return Resource collection API of GlobalAdministrators. + */ + public GlobalAdministrators globalAdministrators() { + if (this.globalAdministrators == null) { + this.globalAdministrators = new GlobalAdministratorsImpl(clientObject.getGlobalAdministrators(), this); + } + return globalAdministrators; + } + + /** + * Gets the resource collection API of DenyAssignments. + * + * @return Resource collection API of DenyAssignments. + */ + public DenyAssignments denyAssignments() { + if (this.denyAssignments == null) { + this.denyAssignments = new DenyAssignmentsImpl(clientObject.getDenyAssignments(), this); + } + return denyAssignments; + } + + /** + * Gets the resource collection API of ProviderOperationsMetadatas. + * + * @return Resource collection API of ProviderOperationsMetadatas. + */ + public ProviderOperationsMetadatas providerOperationsMetadatas() { + if (this.providerOperationsMetadatas == null) { + this.providerOperationsMetadatas = + new ProviderOperationsMetadatasImpl(clientObject.getProviderOperationsMetadatas(), this); + } + return providerOperationsMetadatas; + } + + /** + * Gets the resource collection API of RoleAssignments. It manages RoleAssignment. + * + * @return Resource collection API of RoleAssignments. + */ + public RoleAssignments roleAssignments() { + if (this.roleAssignments == null) { + this.roleAssignments = new RoleAssignmentsImpl(clientObject.getRoleAssignments(), this); + } + return roleAssignments; + } + + /** + * Gets the resource collection API of Permissions. + * + * @return Resource collection API of Permissions. + */ + public Permissions permissions() { + if (this.permissions == null) { + this.permissions = new PermissionsImpl(clientObject.getPermissions(), this); + } + return permissions; + } + + /** + * Gets the resource collection API of RoleDefinitions. It manages RoleDefinition. + * + * @return Resource collection API of RoleDefinitions. + */ + public RoleDefinitions roleDefinitions() { + if (this.roleDefinitions == null) { + this.roleDefinitions = new RoleDefinitionsImpl(clientObject.getRoleDefinitions(), this); + } + return roleDefinitions; + } + + /** + * 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; + } + + /** + * Gets the resource collection API of EligibleChildResources. + * + * @return Resource collection API of EligibleChildResources. + */ + public EligibleChildResources eligibleChildResources() { + if (this.eligibleChildResources == null) { + this.eligibleChildResources = + new EligibleChildResourcesImpl(clientObject.getEligibleChildResources(), this); + } + return eligibleChildResources; + } + + /** + * Gets the resource collection API of RoleAssignmentSchedules. + * + * @return Resource collection API of RoleAssignmentSchedules. + */ + public RoleAssignmentSchedules roleAssignmentSchedules() { + if (this.roleAssignmentSchedules == null) { + this.roleAssignmentSchedules = + new RoleAssignmentSchedulesImpl(clientObject.getRoleAssignmentSchedules(), this); + } + return roleAssignmentSchedules; + } + + /** + * Gets the resource collection API of RoleAssignmentScheduleInstances. + * + * @return Resource collection API of RoleAssignmentScheduleInstances. + */ + public RoleAssignmentScheduleInstances roleAssignmentScheduleInstances() { + if (this.roleAssignmentScheduleInstances == null) { + this.roleAssignmentScheduleInstances = + new RoleAssignmentScheduleInstancesImpl(clientObject.getRoleAssignmentScheduleInstances(), this); + } + return roleAssignmentScheduleInstances; + } + + /** + * Gets the resource collection API of RoleAssignmentScheduleRequests. It manages RoleAssignmentScheduleRequest. + * + * @return Resource collection API of RoleAssignmentScheduleRequests. + */ + public RoleAssignmentScheduleRequests roleAssignmentScheduleRequests() { + if (this.roleAssignmentScheduleRequests == null) { + this.roleAssignmentScheduleRequests = + new RoleAssignmentScheduleRequestsImpl(clientObject.getRoleAssignmentScheduleRequests(), this); + } + return roleAssignmentScheduleRequests; + } + + /** + * Gets the resource collection API of RoleEligibilitySchedules. + * + * @return Resource collection API of RoleEligibilitySchedules. + */ + public RoleEligibilitySchedules roleEligibilitySchedules() { + if (this.roleEligibilitySchedules == null) { + this.roleEligibilitySchedules = + new RoleEligibilitySchedulesImpl(clientObject.getRoleEligibilitySchedules(), this); + } + return roleEligibilitySchedules; + } + + /** + * Gets the resource collection API of RoleEligibilityScheduleInstances. + * + * @return Resource collection API of RoleEligibilityScheduleInstances. + */ + public RoleEligibilityScheduleInstances roleEligibilityScheduleInstances() { + if (this.roleEligibilityScheduleInstances == null) { + this.roleEligibilityScheduleInstances = + new RoleEligibilityScheduleInstancesImpl(clientObject.getRoleEligibilityScheduleInstances(), this); + } + return roleEligibilityScheduleInstances; + } + + /** + * Gets the resource collection API of RoleEligibilityScheduleRequests. It manages RoleEligibilityScheduleRequest. + * + * @return Resource collection API of RoleEligibilityScheduleRequests. + */ + public RoleEligibilityScheduleRequests roleEligibilityScheduleRequests() { + if (this.roleEligibilityScheduleRequests == null) { + this.roleEligibilityScheduleRequests = + new RoleEligibilityScheduleRequestsImpl(clientObject.getRoleEligibilityScheduleRequests(), this); + } + return roleEligibilityScheduleRequests; + } + + /** + * Gets the resource collection API of RoleManagementPolicies. + * + * @return Resource collection API of RoleManagementPolicies. + */ + public RoleManagementPolicies roleManagementPolicies() { + if (this.roleManagementPolicies == null) { + this.roleManagementPolicies = + new RoleManagementPoliciesImpl(clientObject.getRoleManagementPolicies(), this); + } + return roleManagementPolicies; + } + + /** + * Gets the resource collection API of RoleManagementPolicyAssignments. It manages RoleManagementPolicyAssignment. + * + * @return Resource collection API of RoleManagementPolicyAssignments. + */ + public RoleManagementPolicyAssignments roleManagementPolicyAssignments() { + if (this.roleManagementPolicyAssignments == null) { + this.roleManagementPolicyAssignments = + new RoleManagementPolicyAssignmentsImpl(clientObject.getRoleManagementPolicyAssignments(), this); + } + return roleManagementPolicyAssignments; + } + + /** + * Gets the resource collection API of Alerts. + * + * @return Resource collection API of Alerts. + */ + public Alerts alerts() { + if (this.alerts == null) { + this.alerts = new AlertsImpl(clientObject.getAlerts(), this); + } + return alerts; + } + + /** + * Gets the resource collection API of AlertConfigurations. + * + * @return Resource collection API of AlertConfigurations. + */ + public AlertConfigurations alertConfigurations() { + if (this.alertConfigurations == null) { + this.alertConfigurations = new AlertConfigurationsImpl(clientObject.getAlertConfigurations(), this); + } + return alertConfigurations; + } + + /** + * Gets the resource collection API of AlertDefinitions. + * + * @return Resource collection API of AlertDefinitions. + */ + public AlertDefinitions alertDefinitions() { + if (this.alertDefinitions == null) { + this.alertDefinitions = new AlertDefinitionsImpl(clientObject.getAlertDefinitions(), this); + } + return alertDefinitions; + } + + /** + * Gets the resource collection API of AlertIncidents. + * + * @return Resource collection API of AlertIncidents. + */ + public AlertIncidents alertIncidents() { + if (this.alertIncidents == null) { + this.alertIncidents = new AlertIncidentsImpl(clientObject.getAlertIncidents(), this); + } + return alertIncidents; + } + + /** + * Gets the resource collection API of AlertOperations. + * + * @return Resource collection API of AlertOperations. + */ + public AlertOperations alertOperations() { + if (this.alertOperations == null) { + this.alertOperations = new AlertOperationsImpl(clientObject.getAlertOperations(), this); + } + return alertOperations; + } + + /** + * @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 000000000000..93f8d7ab2fe3 --- /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. + * + * @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. + * + * @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 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); + + /** + * 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); +} 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 000000000000..58fa435ecd2f --- /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. + * @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); + + /** + * 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); +} 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 000000000000..1b38c8a31946 --- /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 000000000000..9982c2ff0f04 --- /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. + * @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); + + /** + * 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); + + /** + * 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); + + /** + * 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); +} 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 000000000000..57c368b869a2 --- /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. + * @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); + + /** + * 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); +} 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 000000000000..bff9ff6a7e3c --- /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 000000000000..d1023194da9b --- /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 000000000000..c461c849922e --- /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. + * @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); + + /** + * 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); + + /** + * 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); + + /** + * 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); +} 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 000000000000..834f30eb5843 --- /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. + * @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 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 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 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 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 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 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 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 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); + + /** + * 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); +} 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 000000000000..7557eb64f60f --- /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. + * @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); + + /** + * 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); +} 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 000000000000..b0b20e8ba74c --- /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. + * @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); + + /** + * 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); + + /** + * 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); + + /** + * 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); +} 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 000000000000..5accea524040 --- /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 000000000000..af61109e7216 --- /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. + * @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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AlertConfigurationsClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AlertConfigurationsClient.java new file mode 100644 index 000000000000..0835241ad60c --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AlertConfigurationsClient.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.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.AlertConfigurationInner; + +/** An instance of this class provides access to all the operations defined in AlertConfigurationsClient. */ +public interface AlertConfigurationsClient { + /** + * Get the specified alert configuration. + * + * @param scope The scope of the alert configuration. The scope can be any REST resource instance. For example, use + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param alertId The name of the alert configuration to get. + * @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 specified alert configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String scope, String alertId, Context context); + + /** + * Get the specified alert configuration. + * + * @param scope The scope of the alert configuration. The scope can be any REST resource instance. For example, use + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param alertId The name of the alert configuration to get. + * @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 specified alert configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AlertConfigurationInner get(String scope, String alertId); + + /** + * Update an alert configuration. + * + * @param scope The scope of the alert configuration. + * @param alertId The name of the alert configuration to update. + * @param parameters Parameters for the alert configuration. + * @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 updateWithResponse( + String scope, String alertId, AlertConfigurationInner parameters, Context context); + + /** + * Update an alert configuration. + * + * @param scope The scope of the alert configuration. + * @param alertId The name of the alert configuration to update. + * @param parameters Parameters for the alert configuration. + * @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 update(String scope, String alertId, AlertConfigurationInner parameters); + + /** + * Gets alert configurations for a resource scope. + * + * @param scope The scope of the alert configuration. + * @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 alert configurations for a resource scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForScope(String scope); + + /** + * Gets alert configurations for a resource scope. + * + * @param scope The scope of the alert configuration. + * @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 alert configurations for a resource scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForScope(String scope, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AlertDefinitionsClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AlertDefinitionsClient.java new file mode 100644 index 000000000000..a39987e32870 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AlertDefinitionsClient.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.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.AlertDefinitionInner; + +/** An instance of this class provides access to all the operations defined in AlertDefinitionsClient. */ +public interface AlertDefinitionsClient { + /** + * Get the specified alert definition. + * + * @param scope The scope of the alert definition. The scope can be any REST resource instance. For example, use + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param alertDefinitionId The name of the alert definition to get. + * @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 specified alert definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String scope, String alertDefinitionId, Context context); + + /** + * Get the specified alert definition. + * + * @param scope The scope of the alert definition. The scope can be any REST resource instance. For example, use + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param alertDefinitionId The name of the alert definition to get. + * @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 specified alert definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AlertDefinitionInner get(String scope, String alertDefinitionId); + + /** + * Gets alert definitions for a resource scope. + * + * @param scope The scope of the alert 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 alert definitions for a resource scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForScope(String scope); + + /** + * Gets alert definitions for a resource scope. + * + * @param scope The scope of the alert 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 alert definitions for a resource scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForScope(String scope, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AlertIncidentsClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AlertIncidentsClient.java new file mode 100644 index 000000000000..ae1846fbbe9f --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AlertIncidentsClient.java @@ -0,0 +1,109 @@ +// 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.AlertIncidentInner; + +/** An instance of this class provides access to all the operations defined in AlertIncidentsClient. */ +public interface AlertIncidentsClient { + /** + * Get the specified alert incident. + * + * @param scope The scope of the alert incident. The scope can be any REST resource instance. For example, use + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param alertId The name of the alert. + * @param alertIncidentId The name of the alert incident to get. + * @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 specified alert incident along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String scope, String alertId, String alertIncidentId, Context context); + + /** + * Get the specified alert incident. + * + * @param scope The scope of the alert incident. The scope can be any REST resource instance. For example, use + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param alertId The name of the alert. + * @param alertIncidentId The name of the alert incident to get. + * @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 specified alert incident. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AlertIncidentInner get(String scope, String alertId, String alertIncidentId); + + /** + * Gets alert incidents for a resource scope. + * + * @param scope The scope of the alert incident. + * @param alertId The name of the alert. + * @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 alert incidents for a resource scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForScope(String scope, String alertId); + + /** + * Gets alert incidents for a resource scope. + * + * @param scope The scope of the alert incident. + * @param alertId The name of the alert. + * @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 alert incidents for a resource scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForScope(String scope, String alertId, Context context); + + /** + * Remediate an alert incident. + * + * @param scope The scope of the alert incident. + * @param alertId The name of the alert. + * @param alertIncidentId The name of the alert incident to remediate. + * @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 remediateWithResponse(String scope, String alertId, String alertIncidentId, Context context); + + /** + * Remediate an alert incident. + * + * @param scope The scope of the alert incident. + * @param alertId The name of the alert. + * @param alertIncidentId The name of the alert incident to remediate. + * @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 remediate(String scope, String alertId, String alertIncidentId); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AlertOperationsClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AlertOperationsClient.java new file mode 100644 index 000000000000..c85a518f0c5d --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AlertOperationsClient.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.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.AlertOperationResultInner; + +/** An instance of this class provides access to all the operations defined in AlertOperationsClient. */ +public interface AlertOperationsClient { + /** + * Get the specified alert operation. + * + * @param scope The scope of the alert operation. + * @param operationId The id of the alert operation. + * @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 specified alert operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String scope, String operationId, Context context); + + /** + * Get the specified alert operation. + * + * @param scope The scope of the alert operation. + * @param operationId The id of the alert 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 specified alert operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AlertOperationResultInner get(String scope, String operationId); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AlertsClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AlertsClient.java new file mode 100644 index 000000000000..9b9b72fc8dc4 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AlertsClient.java @@ -0,0 +1,215 @@ +// 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.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.authorization.generated.fluent.models.AlertInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AlertOperationResultInner; + +/** An instance of this class provides access to all the operations defined in AlertsClient. */ +public interface AlertsClient { + /** + * Get the specified alert. + * + * @param scope The scope of the alert. The scope can be any REST resource instance. For example, use + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param alertId The name of the alert to get. + * @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 specified alert along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String scope, String alertId, Context context); + + /** + * Get the specified alert. + * + * @param scope The scope of the alert. The scope can be any REST resource instance. For example, use + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param alertId The name of the alert to get. + * @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 specified alert. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AlertInner get(String scope, String alertId); + + /** + * Update an alert. + * + * @param scope The scope of the alert. + * @param alertId The name of the alert to dismiss. + * @param parameters Parameters for the alert. + * @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 updateWithResponse(String scope, String alertId, AlertInner parameters, Context context); + + /** + * Update an alert. + * + * @param scope The scope of the alert. + * @param alertId The name of the alert to dismiss. + * @param parameters Parameters for the alert. + * @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 update(String scope, String alertId, AlertInner parameters); + + /** + * Gets alerts for a resource scope. + * + * @param scope The scope of the alert. + * @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 alerts for a resource scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForScope(String scope); + + /** + * Gets alerts for a resource scope. + * + * @param scope The scope of the alert. + * @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 alerts for a resource scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForScope(String scope, Context context); + + /** + * Refresh an alert. + * + * @param scope The scope of the alert. + * @param alertId The name of the alert to refresh. + * @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 SyncPoller} for polling of alert operation result. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AlertOperationResultInner> beginRefresh( + String scope, String alertId); + + /** + * Refresh an alert. + * + * @param scope The scope of the alert. + * @param alertId The name of the alert to refresh. + * @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 SyncPoller} for polling of alert operation result. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AlertOperationResultInner> beginRefresh( + String scope, String alertId, Context context); + + /** + * Refresh an alert. + * + * @param scope The scope of the alert. + * @param alertId The name of the alert to refresh. + * @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 alert operation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AlertOperationResultInner refresh(String scope, String alertId); + + /** + * Refresh an alert. + * + * @param scope The scope of the alert. + * @param alertId The name of the alert to refresh. + * @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 alert operation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AlertOperationResultInner refresh(String scope, String alertId, Context context); + + /** + * Refresh all alerts for a resource scope. + * + * @param scope The scope of the alert. + * @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 SyncPoller} for polling of alert operation result. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AlertOperationResultInner> beginRefreshAll(String scope); + + /** + * Refresh all alerts for a resource scope. + * + * @param scope The scope of the alert. + * @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 SyncPoller} for polling of alert operation result. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AlertOperationResultInner> beginRefreshAll( + String scope, Context context); + + /** + * Refresh all alerts for a resource scope. + * + * @param scope The scope of the alert. + * @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 alert operation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AlertOperationResultInner refreshAll(String scope); + + /** + * Refresh all alerts for a resource scope. + * + * @param scope The scope of the alert. + * @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 alert operation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AlertOperationResultInner refreshAll(String scope, 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 000000000000..e8e2bf646570 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/AuthorizationManagementClient.java @@ -0,0 +1,363 @@ +// 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 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 ClassicAdministratorsClient object to access its operations. + * + * @return the ClassicAdministratorsClient object. + */ + ClassicAdministratorsClient getClassicAdministrators(); + + /** + * Gets the GlobalAdministratorsClient object to access its operations. + * + * @return the GlobalAdministratorsClient object. + */ + GlobalAdministratorsClient getGlobalAdministrators(); + + /** + * Gets the DenyAssignmentsClient object to access its operations. + * + * @return the DenyAssignmentsClient object. + */ + DenyAssignmentsClient getDenyAssignments(); + + /** + * Gets the ProviderOperationsMetadatasClient object to access its operations. + * + * @return the ProviderOperationsMetadatasClient object. + */ + ProviderOperationsMetadatasClient getProviderOperationsMetadatas(); + + /** + * Gets the RoleAssignmentsClient object to access its operations. + * + * @return the RoleAssignmentsClient object. + */ + RoleAssignmentsClient getRoleAssignments(); + + /** + * Gets the PermissionsClient object to access its operations. + * + * @return the PermissionsClient object. + */ + PermissionsClient getPermissions(); + + /** + * Gets the RoleDefinitionsClient object to access its operations. + * + * @return the RoleDefinitionsClient object. + */ + RoleDefinitionsClient getRoleDefinitions(); + + /** + * 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(); + + /** + * Gets the EligibleChildResourcesClient object to access its operations. + * + * @return the EligibleChildResourcesClient object. + */ + EligibleChildResourcesClient getEligibleChildResources(); + + /** + * Gets the RoleAssignmentSchedulesClient object to access its operations. + * + * @return the RoleAssignmentSchedulesClient object. + */ + RoleAssignmentSchedulesClient getRoleAssignmentSchedules(); + + /** + * Gets the RoleAssignmentScheduleInstancesClient object to access its operations. + * + * @return the RoleAssignmentScheduleInstancesClient object. + */ + RoleAssignmentScheduleInstancesClient getRoleAssignmentScheduleInstances(); + + /** + * Gets the RoleAssignmentScheduleRequestsClient object to access its operations. + * + * @return the RoleAssignmentScheduleRequestsClient object. + */ + RoleAssignmentScheduleRequestsClient getRoleAssignmentScheduleRequests(); + + /** + * Gets the RoleEligibilitySchedulesClient object to access its operations. + * + * @return the RoleEligibilitySchedulesClient object. + */ + RoleEligibilitySchedulesClient getRoleEligibilitySchedules(); + + /** + * Gets the RoleEligibilityScheduleInstancesClient object to access its operations. + * + * @return the RoleEligibilityScheduleInstancesClient object. + */ + RoleEligibilityScheduleInstancesClient getRoleEligibilityScheduleInstances(); + + /** + * Gets the RoleEligibilityScheduleRequestsClient object to access its operations. + * + * @return the RoleEligibilityScheduleRequestsClient object. + */ + RoleEligibilityScheduleRequestsClient getRoleEligibilityScheduleRequests(); + + /** + * Gets the RoleManagementPoliciesClient object to access its operations. + * + * @return the RoleManagementPoliciesClient object. + */ + RoleManagementPoliciesClient getRoleManagementPolicies(); + + /** + * Gets the RoleManagementPolicyAssignmentsClient object to access its operations. + * + * @return the RoleManagementPolicyAssignmentsClient object. + */ + RoleManagementPolicyAssignmentsClient getRoleManagementPolicyAssignments(); + + /** + * Gets the AlertsClient object to access its operations. + * + * @return the AlertsClient object. + */ + AlertsClient getAlerts(); + + /** + * Gets the AlertConfigurationsClient object to access its operations. + * + * @return the AlertConfigurationsClient object. + */ + AlertConfigurationsClient getAlertConfigurations(); + + /** + * Gets the AlertDefinitionsClient object to access its operations. + * + * @return the AlertDefinitionsClient object. + */ + AlertDefinitionsClient getAlertDefinitions(); + + /** + * Gets the AlertIncidentsClient object to access its operations. + * + * @return the AlertIncidentsClient object. + */ + AlertIncidentsClient getAlertIncidents(); + + /** + * Gets the AlertOperationsClient object to access its operations. + * + * @return the AlertOperationsClient object. + */ + AlertOperationsClient getAlertOperations(); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ClassicAdministratorsClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ClassicAdministratorsClient.java new file mode 100644 index 000000000000..89b452aaf05a --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ClassicAdministratorsClient.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.ClassicAdministratorInner; + +/** An instance of this class provides access to all the operations defined in ClassicAdministratorsClient. */ +public interface ClassicAdministratorsClient { + /** + * Gets service administrator, account administrator, and co-administrators 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 service administrator, account administrator, and co-administrators for the subscription as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets service administrator, account administrator, and co-administrators 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 service administrator, account administrator, and co-administrators for the subscription 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/DenyAssignmentsClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/DenyAssignmentsClient.java new file mode 100644 index 000000000000..5b865b30f760 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/DenyAssignmentsClient.java @@ -0,0 +1,222 @@ +// 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.DenyAssignmentInner; + +/** An instance of this class provides access to all the operations defined in DenyAssignmentsClient. */ +public interface DenyAssignmentsClient { + /** + * Gets deny assignments for a resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get deny assignments 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 deny assignments for a resource as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForResource( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName); + + /** + * Gets deny assignments for a resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get deny assignments for. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or + * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified + * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the + * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and + * below the scope for the specified principal. This filter is different from the principalId filter as it + * returns not only those deny assignments that contain the specified principal is the Principals list but also + * those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when + * gdprExportPrincipalId filter is used, only the deny assignment name and description properties 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 deny assignments for a resource as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForResource( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String filter, + Context context); + + /** + * Gets deny assignments for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 deny assignments for a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets deny assignments for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or + * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified + * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the + * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and + * below the scope for the specified principal. This filter is different from the principalId filter as it + * returns not only those deny assignments that contain the specified principal is the Principals list but also + * those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when + * gdprExportPrincipalId filter is used, only the deny assignment name and description properties 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 deny assignments for a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, String filter, Context context); + + /** + * Gets all deny assignments 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 all deny assignments for the subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all deny assignments for the subscription. + * + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or + * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified + * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the + * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and + * below the scope for the specified principal. This filter is different from the principalId filter as it + * returns not only those deny assignments that contain the specified principal is the Principals list but also + * those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when + * gdprExportPrincipalId filter is used, only the deny assignment name and description properties 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 all deny assignments for the subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String filter, Context context); + + /** + * Get the specified deny assignment. + * + * @param scope The scope of the deny assignment. + * @param denyAssignmentId The ID of the deny assignment to get. + * @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 specified deny assignment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String scope, String denyAssignmentId, Context context); + + /** + * Get the specified deny assignment. + * + * @param scope The scope of the deny assignment. + * @param denyAssignmentId The ID of the deny assignment to get. + * @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 specified deny assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DenyAssignmentInner get(String scope, String denyAssignmentId); + + /** + * Gets a deny assignment by ID. + * + * @param denyAssignmentId The fully qualified deny assignment ID. For example, use the format, + * /subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for subscription + * level deny assignments, or /providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for tenant + * level deny assignments. + * @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 a deny assignment by ID along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByIdWithResponse(String denyAssignmentId, Context context); + + /** + * Gets a deny assignment by ID. + * + * @param denyAssignmentId The fully qualified deny assignment ID. For example, use the format, + * /subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for subscription + * level deny assignments, or /providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for tenant + * level deny assignments. + * @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 a deny assignment by ID. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DenyAssignmentInner getById(String denyAssignmentId); + + /** + * Gets deny assignments for a scope. + * + * @param scope The scope of the deny assignments. + * @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 deny assignments for a scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForScope(String scope); + + /** + * Gets deny assignments for a scope. + * + * @param scope The scope of the deny assignments. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or + * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified + * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the + * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and + * below the scope for the specified principal. This filter is different from the principalId filter as it + * returns not only those deny assignments that contain the specified principal is the Principals list but also + * those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when + * gdprExportPrincipalId filter is used, only the deny assignment name and description properties 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 deny assignments for a scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForScope(String scope, String filter, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/EligibleChildResourcesClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/EligibleChildResourcesClient.java new file mode 100644 index 000000000000..eb33b3392c5e --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/EligibleChildResourcesClient.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.EligibleChildResourceInner; + +/** An instance of this class provides access to all the operations defined in EligibleChildResourcesClient. */ +public interface EligibleChildResourcesClient { + /** + * Get the child resources of a resource on which user has eligible access. + * + * @param scope The scope of the role management policy. + * @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 child resources of a resource on which user has eligible access as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable get(String scope); + + /** + * Get the child resources of a resource on which user has eligible access. + * + * @param scope The scope of the role management policy. + * @param filter The filter to apply on the operation. Use $filter=resourceType+eq+'Subscription' to filter on only + * resource of type = 'Subscription'. Use + * $filter=resourceType+eq+'subscription'+or+resourceType+eq+'resourcegroup' to filter on resource of type = + * 'Subscription' or 'ResourceGroup'. + * @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 child resources of a resource on which user has eligible access as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable get(String scope, String filter, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/GlobalAdministratorsClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/GlobalAdministratorsClient.java new file mode 100644 index 000000000000..b893cf80ed51 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/GlobalAdministratorsClient.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.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 GlobalAdministratorsClient. */ +public interface GlobalAdministratorsClient { + /** + * Elevates access for a Global Administrator. + * + * @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 elevateAccessWithResponse(Context context); + + /** + * Elevates access for a Global Administrator. + * + * @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 elevateAccess(); +} 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 000000000000..d360ea26e0c4 --- /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/PermissionsClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/PermissionsClient.java new file mode 100644 index 000000000000..3a7a7a426bed --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/PermissionsClient.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.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.PermissionInner; + +/** An instance of this class provides access to all the operations defined in PermissionsClient. */ +public interface PermissionsClient { + /** + * Gets all permissions the caller has for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 all permissions the caller has for a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all permissions the caller has for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 all permissions the caller has for a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all permissions the caller has for a resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get the permissions 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 all permissions the caller has for a resource as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForResource( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName); + + /** + * Gets all permissions the caller has for a resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get the permissions 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 all permissions the caller has for a resource as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForResource( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ProviderOperationsMetadatasClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ProviderOperationsMetadatasClient.java new file mode 100644 index 000000000000..1193f026b405 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/ProviderOperationsMetadatasClient.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; + +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.ProviderOperationsMetadataInner; + +/** An instance of this class provides access to all the operations defined in ProviderOperationsMetadatasClient. */ +public interface ProviderOperationsMetadatasClient { + /** + * Gets provider operations metadata for the specified resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @param expand Specifies whether to expand the values. + * @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 provider operations metadata for the specified resource provider along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceProviderNamespace, String expand, Context context); + + /** + * Gets provider operations metadata for the specified resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @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 provider operations metadata for the specified resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProviderOperationsMetadataInner get(String resourceProviderNamespace); + + /** + * Gets provider operations metadata for all resource providers. + * + * @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 provider operations metadata for all resource providers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets provider operations metadata for all resource providers. + * + * @param expand Specifies whether to expand the values. + * @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 provider operations metadata for all resource providers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String expand, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleAssignmentScheduleInstancesClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleAssignmentScheduleInstancesClient.java new file mode 100644 index 000000000000..97073891b116 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleAssignmentScheduleInstancesClient.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.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.RoleAssignmentScheduleInstanceInner; + +/** An instance of this class provides access to all the operations defined in RoleAssignmentScheduleInstancesClient. */ +public interface RoleAssignmentScheduleInstancesClient { + /** + * Gets role assignment schedule instances of a role assignment schedule. + * + * @param scope The scope of the role assignment schedule. + * @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 role assignment schedule instances of a role assignment schedule as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForScope(String scope); + + /** + * Gets role assignment schedule instances of a role assignment schedule. + * + * @param scope The scope of the role assignment schedule. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + * at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or + * below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment + * schedule instances for the user. Use $filter=asTarget() to return all role assignment schedule instances + * created for the current user. + * @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 role assignment schedule instances of a role assignment schedule as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForScope(String scope, String filter, Context context); + + /** + * Gets the specified role assignment schedule instance. + * + * @param scope The scope of the role assignments schedules. + * @param roleAssignmentScheduleInstanceName The name (hash of schedule name + time) of the role assignment schedule + * to get. + * @param 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 specified role assignment schedule instance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String scope, String roleAssignmentScheduleInstanceName, Context context); + + /** + * Gets the specified role assignment schedule instance. + * + * @param scope The scope of the role assignments schedules. + * @param roleAssignmentScheduleInstanceName The name (hash of schedule name + time) of the role assignment schedule + * to get. + * @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 specified role assignment schedule instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoleAssignmentScheduleInstanceInner get(String scope, String roleAssignmentScheduleInstanceName); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleAssignmentScheduleRequestsClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleAssignmentScheduleRequestsClient.java new file mode 100644 index 000000000000..e0f50b359d4d --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleAssignmentScheduleRequestsClient.java @@ -0,0 +1,182 @@ +// 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.RoleAssignmentScheduleRequestInner; + +/** An instance of this class provides access to all the operations defined in RoleAssignmentScheduleRequestsClient. */ +public interface RoleAssignmentScheduleRequestsClient { + /** + * Creates a role assignment schedule request. + * + * @param scope The scope of the role assignment schedule request to create. The scope can be any REST resource + * instance. For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a + * subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param roleAssignmentScheduleRequestName A GUID for the role assignment to create. The name must be unique and + * different for each role assignment. + * @param parameters Parameters for the role assignment schedule request. + * @param 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 role Assignment schedule request along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String scope, + String roleAssignmentScheduleRequestName, + RoleAssignmentScheduleRequestInner parameters, + Context context); + + /** + * Creates a role assignment schedule request. + * + * @param scope The scope of the role assignment schedule request to create. The scope can be any REST resource + * instance. For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a + * subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param roleAssignmentScheduleRequestName A GUID for the role assignment to create. The name must be unique and + * different for each role assignment. + * @param parameters Parameters for the role assignment schedule request. + * @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 role Assignment schedule request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoleAssignmentScheduleRequestInner create( + String scope, String roleAssignmentScheduleRequestName, RoleAssignmentScheduleRequestInner parameters); + + /** + * Get the specified role assignment schedule request. + * + * @param scope The scope of the role assignment schedule request. + * @param roleAssignmentScheduleRequestName The name (guid) of the role assignment schedule request to get. + * @param 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 specified role assignment schedule request along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String scope, String roleAssignmentScheduleRequestName, Context context); + + /** + * Get the specified role assignment schedule request. + * + * @param scope The scope of the role assignment schedule request. + * @param roleAssignmentScheduleRequestName The name (guid) of the role assignment schedule request to get. + * @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 specified role assignment schedule request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoleAssignmentScheduleRequestInner get(String scope, String roleAssignmentScheduleRequestName); + + /** + * Gets role assignment schedule requests for a scope. + * + * @param scope The scope of the role assignments schedule requests. + * @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 role assignment schedule requests for a scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForScope(String scope); + + /** + * Gets role assignment schedule requests for a scope. + * + * @param scope The scope of the role assignments schedule requests. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedule + * requests at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedule + * requests at, above or below the scope for the specified principal. Use $filter=asRequestor() to return all + * role assignment schedule requests requested by the current user. Use $filter=asTarget() to return all role + * assignment schedule requests created for the current user. Use $filter=asApprover() to return all role + * assignment schedule requests where the current user is an approver. + * @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 role assignment schedule requests for a scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForScope(String scope, String filter, Context context); + + /** + * Cancels a pending role assignment schedule request. + * + * @param scope The scope of the role assignment request to cancel. + * @param roleAssignmentScheduleRequestName The name of the role assignment request to cancel. + * @param 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 cancelWithResponse(String scope, String roleAssignmentScheduleRequestName, Context context); + + /** + * Cancels a pending role assignment schedule request. + * + * @param scope The scope of the role assignment request to cancel. + * @param roleAssignmentScheduleRequestName The name of the role assignment request to cancel. + * @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 cancel(String scope, String roleAssignmentScheduleRequestName); + + /** + * Validates a new role assignment schedule request. + * + * @param scope The scope of the role assignment request to validate. + * @param roleAssignmentScheduleRequestName The name of the role assignment request to validate. + * @param parameters Parameters for the role assignment schedule request. + * @param 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 role Assignment schedule request along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response validateWithResponse( + String scope, + String roleAssignmentScheduleRequestName, + RoleAssignmentScheduleRequestInner parameters, + Context context); + + /** + * Validates a new role assignment schedule request. + * + * @param scope The scope of the role assignment request to validate. + * @param roleAssignmentScheduleRequestName The name of the role assignment request to validate. + * @param parameters Parameters for the role assignment schedule request. + * @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 role Assignment schedule request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoleAssignmentScheduleRequestInner validate( + String scope, String roleAssignmentScheduleRequestName, RoleAssignmentScheduleRequestInner parameters); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleAssignmentSchedulesClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleAssignmentSchedulesClient.java new file mode 100644 index 000000000000..368a90a17779 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleAssignmentSchedulesClient.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.RoleAssignmentScheduleInner; + +/** An instance of this class provides access to all the operations defined in RoleAssignmentSchedulesClient. */ +public interface RoleAssignmentSchedulesClient { + /** + * Get the specified role assignment schedule for a resource scope. + * + * @param scope The scope of the role assignment schedule. + * @param roleAssignmentScheduleName The name (guid) of the role assignment schedule to get. + * @param 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 specified role assignment schedule for a resource scope along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String scope, String roleAssignmentScheduleName, Context context); + + /** + * Get the specified role assignment schedule for a resource scope. + * + * @param scope The scope of the role assignment schedule. + * @param roleAssignmentScheduleName The name (guid) of the role assignment schedule to get. + * @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 specified role assignment schedule for a resource scope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoleAssignmentScheduleInner get(String scope, String roleAssignmentScheduleName); + + /** + * Gets role assignment schedules for a resource scope. + * + * @param scope The scope of the role assignments schedules. + * @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 role assignment schedules for a resource scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForScope(String scope); + + /** + * Gets role assignment schedules for a resource scope. + * + * @param scope The scope of the role assignments schedules. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + * at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or + * below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment + * schedules for the current user. Use $filter=asTarget() to return all role assignment schedules created for + * the current user. + * @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 role assignment schedules for a resource scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForScope(String scope, String filter, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleAssignmentsClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleAssignmentsClient.java new file mode 100644 index 000000000000..710439b28368 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleAssignmentsClient.java @@ -0,0 +1,359 @@ +// 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.RoleAssignmentInner; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignmentCreateParameters; + +/** An instance of this class provides access to all the operations defined in RoleAssignmentsClient. */ +public interface RoleAssignmentsClient { + /** + * List all role assignments that apply to a 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 role assignment list operation result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List all role assignments that apply to a subscription. + * + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or + * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope + * for the specified principal. + * @param tenantId Tenant ID for cross-tenant request. + * @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 role assignment list operation result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String filter, String tenantId, Context context); + + /** + * List all role assignments that apply to a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 role assignment list operation result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List all role assignments that apply to a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or + * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope + * for the specified principal. + * @param tenantId Tenant ID for cross-tenant request. + * @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 role assignment list operation result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup( + String resourceGroupName, String filter, String tenantId, Context context); + + /** + * List all role assignments that apply to a resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from + * Microsoft.Web/sites). + * @param resourceName The resource name. + * @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 role assignment list operation result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForResource( + String resourceGroupName, String resourceProviderNamespace, String resourceType, String resourceName); + + /** + * List all role assignments that apply to a resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from + * Microsoft.Web/sites). + * @param resourceName The resource name. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or + * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope + * for the specified principal. + * @param tenantId Tenant ID for cross-tenant request. + * @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 role assignment list operation result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForResource( + String resourceGroupName, + String resourceProviderNamespace, + String resourceType, + String resourceName, + String filter, + String tenantId, + Context context); + + /** + * Get a role assignment by scope and name. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. + * @param tenantId Tenant ID for cross-tenant request. + * @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 a role assignment by scope and name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String scope, String roleAssignmentName, String tenantId, Context context); + + /** + * Get a role assignment by scope and name. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. + * @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 a role assignment by scope and name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoleAssignmentInner get(String scope, String roleAssignmentName); + + /** + * Create or update a role assignment by scope and name. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. + * @param parameters Parameters for the role assignment. + * @param 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 role Assignments along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String scope, String roleAssignmentName, RoleAssignmentCreateParameters parameters, Context context); + + /** + * Create or update a role assignment by scope and name. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. + * @param parameters Parameters for the role assignment. + * @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 role Assignments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoleAssignmentInner create(String scope, String roleAssignmentName, RoleAssignmentCreateParameters parameters); + + /** + * Delete a role assignment by scope and name. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. + * @param tenantId Tenant ID for cross-tenant request. + * @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 role Assignments along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String scope, String roleAssignmentName, String tenantId, Context context); + + /** + * Delete a role assignment by scope and name. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. + * @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 role Assignments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoleAssignmentInner delete(String scope, String roleAssignmentName); + + /** + * List all role assignments that apply to a scope. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @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 role assignment list operation result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForScope(String scope); + + /** + * List all role assignments that apply to a scope. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or + * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope + * for the specified principal. + * @param tenantId Tenant ID for cross-tenant request. + * @param skipToken The skipToken to apply on the operation. Use $skipToken={skiptoken} to return paged role + * assignments following the skipToken passed. Only supported on provider level calls. + * @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 role assignment list operation result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForScope( + String scope, String filter, String tenantId, String skipToken, Context context); + + /** + * Get a role assignment by ID. + * + * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource name, and + * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + * Example: + * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. + * @param tenantId Tenant ID for cross-tenant request. + * @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 a role assignment by ID along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByIdWithResponse(String roleAssignmentId, String tenantId, Context context); + + /** + * Get a role assignment by ID. + * + * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource name, and + * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + * Example: + * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. + * @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 a role assignment by ID. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoleAssignmentInner getById(String roleAssignmentId); + + /** + * Create or update a role assignment by ID. + * + * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource name, and + * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + * Example: + * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. + * @param parameters Parameters for the role assignment. + * @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 role Assignments along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createByIdWithResponse( + String roleAssignmentId, RoleAssignmentCreateParameters parameters, Context context); + + /** + * Create or update a role assignment by ID. + * + * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource name, and + * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + * Example: + * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. + * @param parameters Parameters for the role assignment. + * @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 role Assignments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoleAssignmentInner createById(String roleAssignmentId, RoleAssignmentCreateParameters parameters); + + /** + * Delete a role assignment by ID. + * + * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource name, and + * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + * Example: + * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. + * @param tenantId Tenant ID for cross-tenant request. + * @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 role Assignments along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteByIdWithResponse(String roleAssignmentId, String tenantId, Context context); + + /** + * Delete a role assignment by ID. + * + * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource name, and + * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + * Example: + * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. + * @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 role Assignments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoleAssignmentInner deleteById(String roleAssignmentId); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleDefinitionsClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleDefinitionsClient.java new file mode 100644 index 000000000000..fd3f337d326d --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleDefinitionsClient.java @@ -0,0 +1,183 @@ +// 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.RoleDefinitionInner; + +/** An instance of this class provides access to all the operations defined in RoleDefinitionsClient. */ +public interface RoleDefinitionsClient { + /** + * Deletes a role definition. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleDefinitionId The ID of the role definition to delete. + * @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 role definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String scope, String roleDefinitionId, Context context); + + /** + * Deletes a role definition. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleDefinitionId The ID of the role definition to delete. + * @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 role definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoleDefinitionInner delete(String scope, String roleDefinitionId); + + /** + * Get role definition by ID (GUID). + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleDefinitionId The ID of the role 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 role definition by ID (GUID) along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String scope, String roleDefinitionId, Context context); + + /** + * Get role definition by ID (GUID). + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleDefinitionId The ID of the role 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 role definition by ID (GUID). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoleDefinitionInner get(String scope, String roleDefinitionId); + + /** + * Creates or updates a role definition. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleDefinitionId The ID of the role definition. + * @param roleDefinition The values for the role 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 role definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String scope, String roleDefinitionId, RoleDefinitionInner roleDefinition, Context context); + + /** + * Creates or updates a role definition. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleDefinitionId The ID of the role definition. + * @param roleDefinition The values for the role 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 role definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoleDefinitionInner createOrUpdate(String scope, String roleDefinitionId, RoleDefinitionInner roleDefinition); + + /** + * Get all role definitions that are applicable at scope and above. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @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 all role definitions that are applicable at scope and above as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String scope); + + /** + * Get all role definitions that are applicable at scope and above. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param filter The filter to apply on the operation. Use atScopeAndBelow filter to search below the given scope as + * well. + * @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 all role definitions that are applicable at scope and above as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String scope, String filter, Context context); + + /** + * Gets a role definition by ID. + * + * @param roleId The fully qualified role definition ID. Use the format, + * /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for subscription + * level role definitions, or /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for tenant + * level role definitions. + * @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 a role definition by ID along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByIdWithResponse(String roleId, Context context); + + /** + * Gets a role definition by ID. + * + * @param roleId The fully qualified role definition ID. Use the format, + * /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for subscription + * level role definitions, or /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for tenant + * level role definitions. + * @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 a role definition by ID. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoleDefinitionInner getById(String roleId); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleEligibilityScheduleInstancesClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleEligibilityScheduleInstancesClient.java new file mode 100644 index 000000000000..c850b799e93e --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleEligibilityScheduleInstancesClient.java @@ -0,0 +1,79 @@ +// 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.RoleEligibilityScheduleInstanceInner; + +/** + * An instance of this class provides access to all the operations defined in RoleEligibilityScheduleInstancesClient. + */ +public interface RoleEligibilityScheduleInstancesClient { + /** + * Gets role eligibility schedule instances of a role eligibility schedule. + * + * @param scope The scope of the role eligibility schedule. + * @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 role eligibility schedule instances of a role eligibility schedule as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForScope(String scope); + + /** + * Gets role eligibility schedule instances of a role eligibility schedule. + * + * @param scope The scope of the role eligibility schedule. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + * at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or + * below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role + * eligibility schedules for the user. Use $filter=asTarget() to return all role eligibility schedules created + * for the current user. + * @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 role eligibility schedule instances of a role eligibility schedule as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForScope(String scope, String filter, Context context); + + /** + * Gets the specified role eligibility schedule instance. + * + * @param scope The scope of the role eligibility schedules. + * @param roleEligibilityScheduleInstanceName The name (hash of schedule name + time) of the role eligibility + * schedule to get. + * @param 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 specified role eligibility schedule instance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String scope, String roleEligibilityScheduleInstanceName, Context context); + + /** + * Gets the specified role eligibility schedule instance. + * + * @param scope The scope of the role eligibility schedules. + * @param roleEligibilityScheduleInstanceName The name (hash of schedule name + time) of the role eligibility + * schedule to get. + * @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 specified role eligibility schedule instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoleEligibilityScheduleInstanceInner get(String scope, String roleEligibilityScheduleInstanceName); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleEligibilityScheduleRequestsClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleEligibilityScheduleRequestsClient.java new file mode 100644 index 000000000000..ce8cc0b3e636 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleEligibilityScheduleRequestsClient.java @@ -0,0 +1,180 @@ +// 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.RoleEligibilityScheduleRequestInner; + +/** An instance of this class provides access to all the operations defined in RoleEligibilityScheduleRequestsClient. */ +public interface RoleEligibilityScheduleRequestsClient { + /** + * Creates a role eligibility schedule request. + * + * @param scope The scope of the role eligibility schedule request to create. The scope can be any REST resource + * instance. For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a + * subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param roleEligibilityScheduleRequestName The name of the role eligibility to create. It can be any valid GUID. + * @param parameters Parameters for the role eligibility schedule request. + * @param 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 role Eligibility schedule request along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String scope, + String roleEligibilityScheduleRequestName, + RoleEligibilityScheduleRequestInner parameters, + Context context); + + /** + * Creates a role eligibility schedule request. + * + * @param scope The scope of the role eligibility schedule request to create. The scope can be any REST resource + * instance. For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a + * subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param roleEligibilityScheduleRequestName The name of the role eligibility to create. It can be any valid GUID. + * @param parameters Parameters for the role eligibility schedule request. + * @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 role Eligibility schedule request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoleEligibilityScheduleRequestInner create( + String scope, String roleEligibilityScheduleRequestName, RoleEligibilityScheduleRequestInner parameters); + + /** + * Get the specified role eligibility schedule request. + * + * @param scope The scope of the role eligibility schedule request. + * @param roleEligibilityScheduleRequestName The name (guid) of the role eligibility schedule request to get. + * @param 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 specified role eligibility schedule request along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String scope, String roleEligibilityScheduleRequestName, Context context); + + /** + * Get the specified role eligibility schedule request. + * + * @param scope The scope of the role eligibility schedule request. + * @param roleEligibilityScheduleRequestName The name (guid) of the role eligibility schedule request to get. + * @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 specified role eligibility schedule request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoleEligibilityScheduleRequestInner get(String scope, String roleEligibilityScheduleRequestName); + + /** + * Gets role eligibility schedule requests for a scope. + * + * @param scope The scope of the role eligibility schedule requests. + * @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 role eligibility schedule requests for a scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForScope(String scope); + + /** + * Gets role eligibility schedule requests for a scope. + * + * @param scope The scope of the role eligibility schedule requests. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedule + * requests at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedule + * requests at, above or below the scope for the specified principal. Use $filter=asRequestor() to return all + * role eligibility schedule requests requested by the current user. Use $filter=asTarget() to return all role + * eligibility schedule requests created for the current user. Use $filter=asApprover() to return all role + * eligibility schedule requests where the current user is an approver. + * @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 role eligibility schedule requests for a scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForScope(String scope, String filter, Context context); + + /** + * Cancels a pending role eligibility schedule request. + * + * @param scope The scope of the role eligibility request to cancel. + * @param roleEligibilityScheduleRequestName The name of the role eligibility request to cancel. + * @param 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 cancelWithResponse(String scope, String roleEligibilityScheduleRequestName, Context context); + + /** + * Cancels a pending role eligibility schedule request. + * + * @param scope The scope of the role eligibility request to cancel. + * @param roleEligibilityScheduleRequestName The name of the role eligibility request to cancel. + * @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 cancel(String scope, String roleEligibilityScheduleRequestName); + + /** + * Validates a new role eligibility schedule request. + * + * @param scope The scope of the role eligibility request to validate. + * @param roleEligibilityScheduleRequestName The name of the role eligibility request to validate. + * @param parameters Parameters for the role eligibility schedule request. + * @param 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 role Eligibility schedule request along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response validateWithResponse( + String scope, + String roleEligibilityScheduleRequestName, + RoleEligibilityScheduleRequestInner parameters, + Context context); + + /** + * Validates a new role eligibility schedule request. + * + * @param scope The scope of the role eligibility request to validate. + * @param roleEligibilityScheduleRequestName The name of the role eligibility request to validate. + * @param parameters Parameters for the role eligibility schedule request. + * @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 role Eligibility schedule request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoleEligibilityScheduleRequestInner validate( + String scope, String roleEligibilityScheduleRequestName, RoleEligibilityScheduleRequestInner parameters); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleEligibilitySchedulesClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleEligibilitySchedulesClient.java new file mode 100644 index 000000000000..39d536fef215 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleEligibilitySchedulesClient.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.RoleEligibilityScheduleInner; + +/** An instance of this class provides access to all the operations defined in RoleEligibilitySchedulesClient. */ +public interface RoleEligibilitySchedulesClient { + /** + * Get the specified role eligibility schedule for a resource scope. + * + * @param scope The scope of the role eligibility schedule. + * @param roleEligibilityScheduleName The name (guid) of the role eligibility schedule to get. + * @param 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 specified role eligibility schedule for a resource scope along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String scope, String roleEligibilityScheduleName, Context context); + + /** + * Get the specified role eligibility schedule for a resource scope. + * + * @param scope The scope of the role eligibility schedule. + * @param roleEligibilityScheduleName The name (guid) of the role eligibility schedule to get. + * @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 specified role eligibility schedule for a resource scope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoleEligibilityScheduleInner get(String scope, String roleEligibilityScheduleName); + + /** + * Gets role eligibility schedules for a resource scope. + * + * @param scope The scope of the role eligibility schedules. + * @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 role eligibility schedules for a resource scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForScope(String scope); + + /** + * Gets role eligibility schedules for a resource scope. + * + * @param scope The scope of the role eligibility schedules. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role eligibility + * schedules at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedules at, + * above or below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role + * eligibility schedules for the user. Use $filter=asTarget() to return all role eligibility schedules created + * for the current user. + * @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 role eligibility schedules for a resource scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForScope(String scope, String filter, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleManagementPoliciesClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleManagementPoliciesClient.java new file mode 100644 index 000000000000..1a8a5b1e9df7 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleManagementPoliciesClient.java @@ -0,0 +1,124 @@ +// 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.RoleManagementPolicyInner; + +/** An instance of this class provides access to all the operations defined in RoleManagementPoliciesClient. */ +public interface RoleManagementPoliciesClient { + /** + * Get the specified role management policy for a resource scope. + * + * @param scope The scope of the role management policy. + * @param roleManagementPolicyName The name (guid) of the role management policy to get. + * @param 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 specified role management policy for a resource scope along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String scope, String roleManagementPolicyName, Context context); + + /** + * Get the specified role management policy for a resource scope. + * + * @param scope The scope of the role management policy. + * @param roleManagementPolicyName The name (guid) of the role management policy to get. + * @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 specified role management policy for a resource scope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoleManagementPolicyInner get(String scope, String roleManagementPolicyName); + + /** + * Update a role management policy. + * + * @param scope The scope of the role management policy to upsert. + * @param roleManagementPolicyName The name (guid) of the role management policy to upsert. + * @param parameters Parameters for the role management policy. + * @param 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 role management policy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String scope, String roleManagementPolicyName, RoleManagementPolicyInner parameters, Context context); + + /** + * Update a role management policy. + * + * @param scope The scope of the role management policy to upsert. + * @param roleManagementPolicyName The name (guid) of the role management policy to upsert. + * @param parameters Parameters for the role management policy. + * @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 role management policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoleManagementPolicyInner update( + String scope, String roleManagementPolicyName, RoleManagementPolicyInner parameters); + + /** + * Delete a role management policy. + * + * @param scope The scope of the role management policy to upsert. + * @param roleManagementPolicyName The name (guid) of the role management policy to upsert. + * @param 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 deleteWithResponse(String scope, String roleManagementPolicyName, Context context); + + /** + * Delete a role management policy. + * + * @param scope The scope of the role management policy to upsert. + * @param roleManagementPolicyName The name (guid) of the role management policy to upsert. + * @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 delete(String scope, String roleManagementPolicyName); + + /** + * Gets role management policies for a resource scope. + * + * @param scope The scope of the role management policy. + * @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 role management policies for a resource scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForScope(String scope); + + /** + * Gets role management policies for a resource scope. + * + * @param scope The scope of the role management policy. + * @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 role management policies for a resource scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForScope(String scope, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleManagementPolicyAssignmentsClient.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleManagementPolicyAssignmentsClient.java new file mode 100644 index 000000000000..0c59eb27e574 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/RoleManagementPolicyAssignmentsClient.java @@ -0,0 +1,136 @@ +// 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.RoleManagementPolicyAssignmentInner; + +/** An instance of this class provides access to all the operations defined in RoleManagementPolicyAssignmentsClient. */ +public interface RoleManagementPolicyAssignmentsClient { + /** + * Get the specified role management policy assignment for a resource scope. + * + * @param scope The scope of the role management policy. + * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy assignment to + * get. + * @param 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 specified role management policy assignment for a resource scope along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String scope, String roleManagementPolicyAssignmentName, Context context); + + /** + * Get the specified role management policy assignment for a resource scope. + * + * @param scope The scope of the role management policy. + * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy assignment to + * get. + * @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 specified role management policy assignment for a resource scope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoleManagementPolicyAssignmentInner get(String scope, String roleManagementPolicyAssignmentName); + + /** + * Create a role management policy assignment. + * + * @param scope The scope of the role management policy assignment to upsert. + * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy assignment to + * upsert. + * @param parameters Parameters for the role management policy assignment. + * @param 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 role management policy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String scope, + String roleManagementPolicyAssignmentName, + RoleManagementPolicyAssignmentInner parameters, + Context context); + + /** + * Create a role management policy assignment. + * + * @param scope The scope of the role management policy assignment to upsert. + * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy assignment to + * upsert. + * @param parameters Parameters for the role management policy assignment. + * @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 role management policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoleManagementPolicyAssignmentInner create( + String scope, String roleManagementPolicyAssignmentName, RoleManagementPolicyAssignmentInner parameters); + + /** + * Delete a role management policy assignment. + * + * @param scope The scope of the role management policy assignment to delete. + * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy assignment to + * delete. + * @param 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 deleteWithResponse(String scope, String roleManagementPolicyAssignmentName, Context context); + + /** + * Delete a role management policy assignment. + * + * @param scope The scope of the role management policy assignment to delete. + * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy assignment to + * delete. + * @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 delete(String scope, String roleManagementPolicyAssignmentName); + + /** + * Gets role management assignment policies for a resource scope. + * + * @param scope The scope of the role management policy. + * @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 role management assignment policies for a resource scope as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForScope(String scope); + + /** + * Gets role management assignment policies for a resource scope. + * + * @param scope The scope of the role management policy. + * @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 role management assignment policies for a resource scope as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForScope(String scope, 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 000000000000..c3adf52cf8e7 --- /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. + * @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. + * @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 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); + + /** + * 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); +} 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 000000000000..dba1792d80f8 --- /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. + * @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); + + /** + * 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); +} 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 000000000000..dcca77dc2579 --- /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 000000000000..c8f18e1d38f1 --- /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. + * @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); + + /** + * 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); + + /** + * 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); + + /** + * 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); +} 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 000000000000..44c883e63dbd --- /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. + * @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); + + /** + * 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); +} 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 000000000000..4ffb0135d526 --- /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 000000000000..f933d8f8ad62 --- /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 000000000000..c88fc36ba09b --- /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. + * @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 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 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 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 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 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 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 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 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); + + /** + * 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); +} 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 000000000000..0b2e353f88a3 --- /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. + * @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); + + /** + * 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); + + /** + * 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); + + /** + * 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); +} 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 000000000000..a9045b8cfc90 --- /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. + * @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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); +} 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 000000000000..ef695f5331f4 --- /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 000000000000..bf5273820521 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewActorIdentity.java @@ -0,0 +1,85 @@ +// 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 final 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; + + /** Creates an instance of AccessReviewActorIdentity class. */ + public AccessReviewActorIdentity() { + } + + /** + * 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 000000000000..bd5cb46310a4 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewContactedReviewerInner.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.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Access Review Contacted Reviewer. */ +@Immutable +public final class AccessReviewContactedReviewerInner extends ProxyResource { + /* + * Access Review Contacted Reviewer properties. + */ + @JsonProperty(value = "properties") + private AccessReviewContactedReviewerProperties innerProperties; + + /** Creates an instance of AccessReviewContactedReviewerInner class. */ + public AccessReviewContactedReviewerInner() { + } + + /** + * 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 000000000000..6b78cc260189 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewContactedReviewerProperties.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.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; + + /** Creates an instance of AccessReviewContactedReviewerProperties class. */ + public AccessReviewContactedReviewerProperties() { + } + + /** + * 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/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 000000000000..3f88d0af1268 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewDecisionInner.java @@ -0,0 +1,282 @@ +// 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.AccessReviewDecisionIdentity; +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; + + /** Creates an instance of AccessReviewDecisionInner class. */ + public AccessReviewDecisionInner() { + } + + /** + * Get the innerProperties property: Access Review Decision properties. + * + * @return the innerProperties value. + */ + private AccessReviewDecisionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the principal property: Principal associated with the decision record. Can be + * AccessReviewDecisionUserIdentity or AccessReviewDecisionServicePrincipalIdentity. + * + * @return the principal value. + */ + public AccessReviewDecisionIdentity principal() { + return this.innerProperties() == null ? null : this.innerProperties().principal(); + } + + /** + * 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 type property: The type of resource. + * + * @return the type value. + */ + public DecisionResourceType typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Get the id property: The id of resource associated with a decision record. + * + * @return the id value. + */ + public String idPropertiesId() { + return this.innerProperties() == null ? null : this.innerProperties().id(); + } + + /** + * Get the displayName property: The display name of resource associated with a decision record. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * 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/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 000000000000..d20b93c671a5 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewDecisionPrincipalResourceMembership.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.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; + + /** Creates an instance of AccessReviewDecisionPrincipalResourceMembership class. */ + public AccessReviewDecisionPrincipalResourceMembership() { + } + + /** + * 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 000000000000..ac565d8d6f3a --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewDecisionProperties.java @@ -0,0 +1,413 @@ +// 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.AccessReviewDecisionIdentity; +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 principal; + + /* + * 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; + + /** Creates an instance of AccessReviewDecisionProperties class. */ + public AccessReviewDecisionProperties() { + } + + /** + * Get the principal property: Principal associated with the decision record. Can be + * AccessReviewDecisionUserIdentity or AccessReviewDecisionServicePrincipalIdentity. + * + * @return the principal value. + */ + public AccessReviewDecisionIdentity principal() { + return this.principal; + } + + /** + * 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 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 id() { + 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 displayName() { + 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 (principal() != null) { + principal().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 000000000000..97aee5e03bc7 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewDecisionResource.java @@ -0,0 +1,90 @@ +// 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; + + /** Creates an instance of AccessReviewDecisionResource class. */ + public AccessReviewDecisionResource() { + } + + /** + * 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 000000000000..5e6d5de8ff82 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewDefaultSettingsInner.java @@ -0,0 +1,427 @@ +// 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; + + /** Creates an instance of AccessReviewDefaultSettingsInner class. */ + public AccessReviewDefaultSettingsInner() { + } + + /** + * 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 000000000000..e1e35ff9528e --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewHistoryDefinitionInner.java @@ -0,0 +1,365 @@ +// 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; + + /** Creates an instance of AccessReviewHistoryDefinitionInner class. */ + public AccessReviewHistoryDefinitionInner() { + } + + /** + * 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 000000000000..427cfe949b7c --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewHistoryDefinitionProperties.java @@ -0,0 +1,429 @@ +// 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; + + /** Creates an instance of AccessReviewHistoryDefinitionProperties class. */ + public AccessReviewHistoryDefinitionProperties() { + } + + /** + * 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 000000000000..f8a2a8d2760d --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewHistoryInstanceInner.java @@ -0,0 +1,211 @@ +// 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; + + /** Creates an instance of AccessReviewHistoryInstanceInner class. */ + public AccessReviewHistoryInstanceInner() { + } + + /** + * 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 000000000000..9200e251523c --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewHistoryInstanceProperties.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.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; + + /** Creates an instance of AccessReviewHistoryInstanceProperties class. */ + public AccessReviewHistoryInstanceProperties() { + } + + /** + * 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 000000000000..268179e58016 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewHistoryScheduleSettings.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.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; + + /** Creates an instance of AccessReviewHistoryScheduleSettings class. */ + public AccessReviewHistoryScheduleSettings() { + } + + /** + * 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 000000000000..f7334b3e9295 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewInstanceInner.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.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; + + /** Creates an instance of AccessReviewInstanceInner class. */ + public AccessReviewInstanceInner() { + } + + /** + * 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 000000000000..b94bbdbae086 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewInstanceProperties.java @@ -0,0 +1,173 @@ +// 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; + + /** Creates an instance of AccessReviewInstanceProperties class. */ + public AccessReviewInstanceProperties() { + } + + /** + * 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 000000000000..6d477c8dd227 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewRecurrencePattern.java @@ -0,0 +1,79 @@ +// 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; + + /** Creates an instance of AccessReviewRecurrencePattern class. */ + public AccessReviewRecurrencePattern() { + } + + /** + * 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 000000000000..d26c3d1b2184 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewRecurrenceRange.java @@ -0,0 +1,134 @@ +// 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; + + /** Creates an instance of AccessReviewRecurrenceRange class. */ + public AccessReviewRecurrenceRange() { + } + + /** + * 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 000000000000..8e600c94188d --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewRecurrenceSettings.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.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; + + /** Creates an instance of AccessReviewRecurrenceSettings class. */ + public AccessReviewRecurrenceSettings() { + } + + /** + * 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 000000000000..9ee9372d8eb2 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewScheduleDefinitionInner.java @@ -0,0 +1,724 @@ +// 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; + + /** Creates an instance of AccessReviewScheduleDefinitionInner class. */ + public AccessReviewScheduleDefinitionInner() { + } + + /** + * 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 000000000000..834bdd5a7ef9 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewScheduleDefinitionProperties.java @@ -0,0 +1,889 @@ +// 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; + + /** Creates an instance of AccessReviewScheduleDefinitionProperties class. */ + public AccessReviewScheduleDefinitionProperties() { + } + + /** + * 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 000000000000..d23ecaae6072 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewScheduleSettings.java @@ -0,0 +1,456 @@ +// 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; + + /** Creates an instance of AccessReviewScheduleSettings class. */ + public AccessReviewScheduleSettings() { + } + + /** + * 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 000000000000..f62cfd4bbdf4 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AccessReviewScope.java @@ -0,0 +1,249 @@ +// 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; + + /** Creates an instance of AccessReviewScope class. */ + public AccessReviewScope() { + } + + /** + * 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/AlertConfigurationInner.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AlertConfigurationInner.java new file mode 100644 index 000000000000..1837cbde64d8 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AlertConfigurationInner.java @@ -0,0 +1,98 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** Alert configuration. */ +@Fluent +public final class AlertConfigurationInner { + /* + * The alert configuration ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The alert configuration name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The alert configuration type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Alert configuration properties. + */ + @JsonProperty(value = "properties") + private AlertConfigurationPropertiesInner properties; + + /** Creates an instance of AlertConfigurationInner class. */ + public AlertConfigurationInner() { + } + + /** + * Get the id property: The alert configuration ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The alert configuration name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: The alert configuration type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the properties property: Alert configuration properties. + * + * @return the properties value. + */ + public AlertConfigurationPropertiesInner properties() { + return this.properties; + } + + /** + * Set the properties property: Alert configuration properties. + * + * @param properties the properties value to set. + * @return the AlertConfigurationInner object itself. + */ + public AlertConfigurationInner withProperties(AlertConfigurationPropertiesInner properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AlertConfigurationPropertiesInner.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AlertConfigurationPropertiesInner.java new file mode 100644 index 000000000000..f8fc7a28a603 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AlertConfigurationPropertiesInner.java @@ -0,0 +1,125 @@ +// 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.AzureRolesAssignedOutsidePimAlertConfigurationProperties; +import com.azure.resourcemanager.authorization.generated.models.DuplicateRoleCreatedAlertConfigurationProperties; +import com.azure.resourcemanager.authorization.generated.models.TooManyOwnersAssignedToResourceAlertConfigurationProperties; +import com.azure.resourcemanager.authorization.generated.models.TooManyPermanentOwnersAssignedToResourceAlertConfigurationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Alert configuration properties. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "alertConfigurationType", + defaultImpl = AlertConfigurationPropertiesInner.class) +@JsonTypeName("AlertConfigurationProperties") +@JsonSubTypes({ + @JsonSubTypes.Type( + name = "AzureRolesAssignedOutsidePimAlertConfiguration", + value = AzureRolesAssignedOutsidePimAlertConfigurationProperties.class), + @JsonSubTypes.Type( + name = "DuplicateRoleCreatedAlertConfiguration", + value = DuplicateRoleCreatedAlertConfigurationProperties.class), + @JsonSubTypes.Type( + name = "TooManyOwnersAssignedToResourceAlertConfiguration", + value = TooManyOwnersAssignedToResourceAlertConfigurationProperties.class), + @JsonSubTypes.Type( + name = "TooManyPermanentOwnersAssignedToResourceAlertConfiguration", + value = TooManyPermanentOwnersAssignedToResourceAlertConfigurationProperties.class) +}) +@Fluent +public class AlertConfigurationPropertiesInner { + /* + * The alert definition ID. + */ + @JsonProperty(value = "alertDefinitionId", access = JsonProperty.Access.WRITE_ONLY) + private String alertDefinitionId; + + /* + * The alert scope. + */ + @JsonProperty(value = "scope", access = JsonProperty.Access.WRITE_ONLY) + private String scope; + + /* + * True if the alert is enabled, false will disable the scanning for the specific alert. + */ + @JsonProperty(value = "isEnabled") + private Boolean isEnabled; + + /* + * The alert definition. + */ + @JsonProperty(value = "alertDefinition", access = JsonProperty.Access.WRITE_ONLY) + private AlertDefinitionInner alertDefinition; + + /** Creates an instance of AlertConfigurationPropertiesInner class. */ + public AlertConfigurationPropertiesInner() { + } + + /** + * Get the alertDefinitionId property: The alert definition ID. + * + * @return the alertDefinitionId value. + */ + public String alertDefinitionId() { + return this.alertDefinitionId; + } + + /** + * Get the scope property: The alert scope. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Get the isEnabled property: True if the alert is enabled, false will disable the scanning for the specific alert. + * + * @return the isEnabled value. + */ + public Boolean isEnabled() { + return this.isEnabled; + } + + /** + * Set the isEnabled property: True if the alert is enabled, false will disable the scanning for the specific alert. + * + * @param isEnabled the isEnabled value to set. + * @return the AlertConfigurationPropertiesInner object itself. + */ + public AlertConfigurationPropertiesInner withIsEnabled(Boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + /** + * Get the alertDefinition property: The alert definition. + * + * @return the alertDefinition value. + */ + public AlertDefinitionInner alertDefinition() { + return this.alertDefinition; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (alertDefinition() != null) { + alertDefinition().validate(); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AlertDefinitionInner.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AlertDefinitionInner.java new file mode 100644 index 000000000000..5308c0b75ca5 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AlertDefinitionInner.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.Immutable; +import com.azure.resourcemanager.authorization.generated.models.SeverityLevel; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Alert definition. */ +@Immutable +public final class AlertDefinitionInner { + /* + * The alert definition ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The alert definition name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The alert definition type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Alert definition properties. + */ + @JsonProperty(value = "properties") + private AlertDefinitionProperties innerProperties; + + /** Creates an instance of AlertDefinitionInner class. */ + public AlertDefinitionInner() { + } + + /** + * Get the id property: The alert definition ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The alert definition name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: The alert definition type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the innerProperties property: Alert definition properties. + * + * @return the innerProperties value. + */ + private AlertDefinitionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the displayName property: The alert display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Get the scope property: The alert scope. + * + * @return the scope value. + */ + public String scope() { + return this.innerProperties() == null ? null : this.innerProperties().scope(); + } + + /** + * Get the description property: The alert description. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Get the severityLevel property: Severity level of the alert. + * + * @return the severityLevel value. + */ + public SeverityLevel severityLevel() { + return this.innerProperties() == null ? null : this.innerProperties().severityLevel(); + } + + /** + * Get the securityImpact property: Security impact of the alert. + * + * @return the securityImpact value. + */ + public String securityImpact() { + return this.innerProperties() == null ? null : this.innerProperties().securityImpact(); + } + + /** + * Get the mitigationSteps property: The methods to mitigate the alert. + * + * @return the mitigationSteps value. + */ + public String mitigationSteps() { + return this.innerProperties() == null ? null : this.innerProperties().mitigationSteps(); + } + + /** + * Get the howToPrevent property: The ways to prevent the alert. + * + * @return the howToPrevent value. + */ + public String howToPrevent() { + return this.innerProperties() == null ? null : this.innerProperties().howToPrevent(); + } + + /** + * Get the isRemediatable property: True if the alert can be remediated; false, otherwise. + * + * @return the isRemediatable value. + */ + public Boolean isRemediatable() { + return this.innerProperties() == null ? null : this.innerProperties().isRemediatable(); + } + + /** + * Get the isConfigurable property: True if the alert configuration can be configured; false, otherwise. + * + * @return the isConfigurable value. + */ + public Boolean isConfigurable() { + return this.innerProperties() == null ? null : this.innerProperties().isConfigurable(); + } + + /** + * 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/AlertDefinitionProperties.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AlertDefinitionProperties.java new file mode 100644 index 000000000000..d9df588a202b --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AlertDefinitionProperties.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.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.authorization.generated.models.SeverityLevel; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Alert definition properties. */ +@Immutable +public final class AlertDefinitionProperties { + /* + * The alert display name. + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /* + * The alert scope. + */ + @JsonProperty(value = "scope", access = JsonProperty.Access.WRITE_ONLY) + private String scope; + + /* + * The alert description. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * Severity level of the alert. + */ + @JsonProperty(value = "severityLevel", access = JsonProperty.Access.WRITE_ONLY) + private SeverityLevel severityLevel; + + /* + * Security impact of the alert. + */ + @JsonProperty(value = "securityImpact", access = JsonProperty.Access.WRITE_ONLY) + private String securityImpact; + + /* + * The methods to mitigate the alert. + */ + @JsonProperty(value = "mitigationSteps", access = JsonProperty.Access.WRITE_ONLY) + private String mitigationSteps; + + /* + * The ways to prevent the alert. + */ + @JsonProperty(value = "howToPrevent", access = JsonProperty.Access.WRITE_ONLY) + private String howToPrevent; + + /* + * True if the alert can be remediated; false, otherwise. + */ + @JsonProperty(value = "isRemediatable", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isRemediatable; + + /* + * True if the alert configuration can be configured; false, otherwise. + */ + @JsonProperty(value = "isConfigurable", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isConfigurable; + + /** Creates an instance of AlertDefinitionProperties class. */ + public AlertDefinitionProperties() { + } + + /** + * Get the displayName property: The alert display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the scope property: The alert scope. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Get the description property: The alert description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the severityLevel property: Severity level of the alert. + * + * @return the severityLevel value. + */ + public SeverityLevel severityLevel() { + return this.severityLevel; + } + + /** + * Get the securityImpact property: Security impact of the alert. + * + * @return the securityImpact value. + */ + public String securityImpact() { + return this.securityImpact; + } + + /** + * Get the mitigationSteps property: The methods to mitigate the alert. + * + * @return the mitigationSteps value. + */ + public String mitigationSteps() { + return this.mitigationSteps; + } + + /** + * Get the howToPrevent property: The ways to prevent the alert. + * + * @return the howToPrevent value. + */ + public String howToPrevent() { + return this.howToPrevent; + } + + /** + * Get the isRemediatable property: True if the alert can be remediated; false, otherwise. + * + * @return the isRemediatable value. + */ + public Boolean isRemediatable() { + return this.isRemediatable; + } + + /** + * Get the isConfigurable property: True if the alert configuration can be configured; false, otherwise. + * + * @return the isConfigurable value. + */ + public Boolean isConfigurable() { + return this.isConfigurable; + } + + /** + * 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/AlertIncidentInner.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AlertIncidentInner.java new file mode 100644 index 000000000000..0ed4c72c19f9 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AlertIncidentInner.java @@ -0,0 +1,99 @@ +// 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.AlertIncidentProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Alert incident. */ +@Fluent +public final class AlertIncidentInner { + /* + * The alert incident ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The alert incident name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The alert incident type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Alert incident properties. + */ + @JsonProperty(value = "properties") + private AlertIncidentProperties properties; + + /** Creates an instance of AlertIncidentInner class. */ + public AlertIncidentInner() { + } + + /** + * Get the id property: The alert incident ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The alert incident name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: The alert incident type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the properties property: Alert incident properties. + * + * @return the properties value. + */ + public AlertIncidentProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Alert incident properties. + * + * @param properties the properties value to set. + * @return the AlertIncidentInner object itself. + */ + public AlertIncidentInner withProperties(AlertIncidentProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AlertInner.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AlertInner.java new file mode 100644 index 000000000000..3326de2d32a5 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AlertInner.java @@ -0,0 +1,176 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The alert. */ +@Fluent +public final class AlertInner { + /* + * The alert ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The alert name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The alert type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Alert properties. + */ + @JsonProperty(value = "properties") + private AlertPropertiesInner innerProperties; + + /** Creates an instance of AlertInner class. */ + public AlertInner() { + } + + /** + * Get the id property: The alert ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The alert name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: The alert type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the innerProperties property: Alert properties. + * + * @return the innerProperties value. + */ + private AlertPropertiesInner innerProperties() { + return this.innerProperties; + } + + /** + * Get the scope property: The alert scope. + * + * @return the scope value. + */ + public String scope() { + return this.innerProperties() == null ? null : this.innerProperties().scope(); + } + + /** + * Get the isActive property: False by default; true if the alert is active. + * + * @return the isActive value. + */ + public Boolean isActive() { + return this.innerProperties() == null ? null : this.innerProperties().isActive(); + } + + /** + * Set the isActive property: False by default; true if the alert is active. + * + * @param isActive the isActive value to set. + * @return the AlertInner object itself. + */ + public AlertInner withIsActive(Boolean isActive) { + if (this.innerProperties() == null) { + this.innerProperties = new AlertPropertiesInner(); + } + this.innerProperties().withIsActive(isActive); + return this; + } + + /** + * Get the incidentCount property: The number of generated incidents of the alert. + * + * @return the incidentCount value. + */ + public Integer incidentCount() { + return this.innerProperties() == null ? null : this.innerProperties().incidentCount(); + } + + /** + * Get the lastModifiedDateTime property: The date time when the alert configuration was updated or new incidents + * were generated. + * + * @return the lastModifiedDateTime value. + */ + public OffsetDateTime lastModifiedDateTime() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedDateTime(); + } + + /** + * Get the lastScannedDateTime property: The date time when the alert was last scanned. + * + * @return the lastScannedDateTime value. + */ + public OffsetDateTime lastScannedDateTime() { + return this.innerProperties() == null ? null : this.innerProperties().lastScannedDateTime(); + } + + /** + * Get the alertDefinition property: The alert definition. + * + * @return the alertDefinition value. + */ + public AlertDefinitionInner alertDefinition() { + return this.innerProperties() == null ? null : this.innerProperties().alertDefinition(); + } + + /** + * Get the alertIncidents property: The alert incidents. + * + * @return the alertIncidents value. + */ + public List alertIncidents() { + return this.innerProperties() == null ? null : this.innerProperties().alertIncidents(); + } + + /** + * Get the alertConfiguration property: The alert configuration. + * + * @return the alertConfiguration value. + */ + public AlertConfigurationInner alertConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().alertConfiguration(); + } + + /** + * 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/AlertOperationResultInner.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AlertOperationResultInner.java new file mode 100644 index 000000000000..aa838064980f --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AlertOperationResultInner.java @@ -0,0 +1,115 @@ +// 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; + +/** Alert operation result. */ +@Immutable +public final class AlertOperationResultInner { + /* + * The id of the alert operation. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The status of the alert operation. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /* + * The status detail of the alert operation. + */ + @JsonProperty(value = "statusDetail", access = JsonProperty.Access.WRITE_ONLY) + private String statusDetail; + + /* + * The created date of the alert operation. + */ + @JsonProperty(value = "createdDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDateTime; + + /* + * The last action date of the alert operation. + */ + @JsonProperty(value = "lastActionDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastActionDateTime; + + /* + * The location of the alert associated with the operation. + */ + @JsonProperty(value = "resourceLocation", access = JsonProperty.Access.WRITE_ONLY) + private String resourceLocation; + + /** Creates an instance of AlertOperationResultInner class. */ + public AlertOperationResultInner() { + } + + /** + * Get the id property: The id of the alert operation. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the status property: The status of the alert operation. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Get the statusDetail property: The status detail of the alert operation. + * + * @return the statusDetail value. + */ + public String statusDetail() { + return this.statusDetail; + } + + /** + * Get the createdDateTime property: The created date of the alert operation. + * + * @return the createdDateTime value. + */ + public OffsetDateTime createdDateTime() { + return this.createdDateTime; + } + + /** + * Get the lastActionDateTime property: The last action date of the alert operation. + * + * @return the lastActionDateTime value. + */ + public OffsetDateTime lastActionDateTime() { + return this.lastActionDateTime; + } + + /** + * Get the resourceLocation property: The location of the alert associated with the operation. + * + * @return the resourceLocation value. + */ + public String resourceLocation() { + return this.resourceLocation; + } + + /** + * 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/AlertPropertiesInner.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AlertPropertiesInner.java new file mode 100644 index 000000000000..f0910a845faf --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/AlertPropertiesInner.java @@ -0,0 +1,167 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Alert properties. */ +@Fluent +public final class AlertPropertiesInner { + /* + * The alert scope. + */ + @JsonProperty(value = "scope", access = JsonProperty.Access.WRITE_ONLY) + private String scope; + + /* + * False by default; true if the alert is active. + */ + @JsonProperty(value = "isActive") + private Boolean isActive; + + /* + * The number of generated incidents of the alert. + */ + @JsonProperty(value = "incidentCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer incidentCount; + + /* + * The date time when the alert configuration was updated or new incidents were generated. + */ + @JsonProperty(value = "lastModifiedDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedDateTime; + + /* + * The date time when the alert was last scanned. + */ + @JsonProperty(value = "lastScannedDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastScannedDateTime; + + /* + * The alert definition. + */ + @JsonProperty(value = "alertDefinition", access = JsonProperty.Access.WRITE_ONLY) + private AlertDefinitionInner alertDefinition; + + /* + * The alert incidents. + */ + @JsonProperty(value = "alertIncidents", access = JsonProperty.Access.WRITE_ONLY) + private List alertIncidents; + + /* + * The alert configuration. + */ + @JsonProperty(value = "alertConfiguration", access = JsonProperty.Access.WRITE_ONLY) + private AlertConfigurationInner alertConfiguration; + + /** Creates an instance of AlertPropertiesInner class. */ + public AlertPropertiesInner() { + } + + /** + * Get the scope property: The alert scope. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Get the isActive property: False by default; true if the alert is active. + * + * @return the isActive value. + */ + public Boolean isActive() { + return this.isActive; + } + + /** + * Set the isActive property: False by default; true if the alert is active. + * + * @param isActive the isActive value to set. + * @return the AlertPropertiesInner object itself. + */ + public AlertPropertiesInner withIsActive(Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Get the incidentCount property: The number of generated incidents of the alert. + * + * @return the incidentCount value. + */ + public Integer incidentCount() { + return this.incidentCount; + } + + /** + * Get the lastModifiedDateTime property: The date time when the alert configuration was updated or new incidents + * were generated. + * + * @return the lastModifiedDateTime value. + */ + public OffsetDateTime lastModifiedDateTime() { + return this.lastModifiedDateTime; + } + + /** + * Get the lastScannedDateTime property: The date time when the alert was last scanned. + * + * @return the lastScannedDateTime value. + */ + public OffsetDateTime lastScannedDateTime() { + return this.lastScannedDateTime; + } + + /** + * Get the alertDefinition property: The alert definition. + * + * @return the alertDefinition value. + */ + public AlertDefinitionInner alertDefinition() { + return this.alertDefinition; + } + + /** + * Get the alertIncidents property: The alert incidents. + * + * @return the alertIncidents value. + */ + public List alertIncidents() { + return this.alertIncidents; + } + + /** + * Get the alertConfiguration property: The alert configuration. + * + * @return the alertConfiguration value. + */ + public AlertConfigurationInner alertConfiguration() { + return this.alertConfiguration; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (alertDefinition() != null) { + alertDefinition().validate(); + } + if (alertIncidents() != null) { + alertIncidents().forEach(e -> e.validate()); + } + if (alertConfiguration() != null) { + alertConfiguration().validate(); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/ClassicAdministratorInner.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/ClassicAdministratorInner.java new file mode 100644 index 000000000000..e32a616020d2 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/ClassicAdministratorInner.java @@ -0,0 +1,166 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** Classic Administrators. */ +@Fluent +public final class ClassicAdministratorInner { + /* + * The ID of the administrator. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The name of the administrator. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The type of the administrator. + */ + @JsonProperty(value = "type") + private String type; + + /* + * Properties for the classic administrator. + */ + @JsonProperty(value = "properties") + private ClassicAdministratorProperties innerProperties; + + /** Creates an instance of ClassicAdministratorInner class. */ + public ClassicAdministratorInner() { + } + + /** + * Get the id property: The ID of the administrator. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The ID of the administrator. + * + * @param id the id value to set. + * @return the ClassicAdministratorInner object itself. + */ + public ClassicAdministratorInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: The name of the administrator. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the administrator. + * + * @param name the name value to set. + * @return the ClassicAdministratorInner object itself. + */ + public ClassicAdministratorInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The type of the administrator. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The type of the administrator. + * + * @param type the type value to set. + * @return the ClassicAdministratorInner object itself. + */ + public ClassicAdministratorInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get the innerProperties property: Properties for the classic administrator. + * + * @return the innerProperties value. + */ + private ClassicAdministratorProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the emailAddress property: The email address of the administrator. + * + * @return the emailAddress value. + */ + public String emailAddress() { + return this.innerProperties() == null ? null : this.innerProperties().emailAddress(); + } + + /** + * Set the emailAddress property: The email address of the administrator. + * + * @param emailAddress the emailAddress value to set. + * @return the ClassicAdministratorInner object itself. + */ + public ClassicAdministratorInner withEmailAddress(String emailAddress) { + if (this.innerProperties() == null) { + this.innerProperties = new ClassicAdministratorProperties(); + } + this.innerProperties().withEmailAddress(emailAddress); + return this; + } + + /** + * Get the role property: The role of the administrator. + * + * @return the role value. + */ + public String role() { + return this.innerProperties() == null ? null : this.innerProperties().role(); + } + + /** + * Set the role property: The role of the administrator. + * + * @param role the role value to set. + * @return the ClassicAdministratorInner object itself. + */ + public ClassicAdministratorInner withRole(String role) { + if (this.innerProperties() == null) { + this.innerProperties = new ClassicAdministratorProperties(); + } + this.innerProperties().withRole(role); + 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/ClassicAdministratorProperties.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/ClassicAdministratorProperties.java new file mode 100644 index 000000000000..f00b73c3e6f4 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/ClassicAdministratorProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Classic Administrator properties. */ +@Fluent +public final class ClassicAdministratorProperties { + /* + * The email address of the administrator. + */ + @JsonProperty(value = "emailAddress") + private String emailAddress; + + /* + * The role of the administrator. + */ + @JsonProperty(value = "role") + private String role; + + /** Creates an instance of ClassicAdministratorProperties class. */ + public ClassicAdministratorProperties() { + } + + /** + * Get the emailAddress property: The email address of the administrator. + * + * @return the emailAddress value. + */ + public String emailAddress() { + return this.emailAddress; + } + + /** + * Set the emailAddress property: The email address of the administrator. + * + * @param emailAddress the emailAddress value to set. + * @return the ClassicAdministratorProperties object itself. + */ + public ClassicAdministratorProperties withEmailAddress(String emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + /** + * Get the role property: The role of the administrator. + * + * @return the role value. + */ + public String role() { + return this.role; + } + + /** + * Set the role property: The role of the administrator. + * + * @param role the role value to set. + * @return the ClassicAdministratorProperties object itself. + */ + public ClassicAdministratorProperties withRole(String role) { + this.role = role; + 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/DenyAssignmentInner.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/DenyAssignmentInner.java new file mode 100644 index 000000000000..03dc9cd2005a --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/DenyAssignmentInner.java @@ -0,0 +1,365 @@ +// 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.DenyAssignmentPermission; +import com.azure.resourcemanager.authorization.generated.models.Principal; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Deny Assignment. */ +@Fluent +public final class DenyAssignmentInner { + /* + * The deny assignment ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The deny assignment name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The deny assignment type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Deny assignment properties. + */ + @JsonProperty(value = "properties") + private DenyAssignmentProperties innerProperties; + + /** Creates an instance of DenyAssignmentInner class. */ + public DenyAssignmentInner() { + } + + /** + * Get the id property: The deny assignment ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The deny assignment name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: The deny assignment type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the innerProperties property: Deny assignment properties. + * + * @return the innerProperties value. + */ + private DenyAssignmentProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the denyAssignmentName property: The display name of the deny assignment. + * + * @return the denyAssignmentName value. + */ + public String denyAssignmentName() { + return this.innerProperties() == null ? null : this.innerProperties().denyAssignmentName(); + } + + /** + * Set the denyAssignmentName property: The display name of the deny assignment. + * + * @param denyAssignmentName the denyAssignmentName value to set. + * @return the DenyAssignmentInner object itself. + */ + public DenyAssignmentInner withDenyAssignmentName(String denyAssignmentName) { + if (this.innerProperties() == null) { + this.innerProperties = new DenyAssignmentProperties(); + } + this.innerProperties().withDenyAssignmentName(denyAssignmentName); + return this; + } + + /** + * Get the description property: The description of the deny assignment. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: The description of the deny assignment. + * + * @param description the description value to set. + * @return the DenyAssignmentInner object itself. + */ + public DenyAssignmentInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new DenyAssignmentProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the permissions property: An array of permissions that are denied by the deny assignment. + * + * @return the permissions value. + */ + public List permissions() { + return this.innerProperties() == null ? null : this.innerProperties().permissions(); + } + + /** + * Set the permissions property: An array of permissions that are denied by the deny assignment. + * + * @param permissions the permissions value to set. + * @return the DenyAssignmentInner object itself. + */ + public DenyAssignmentInner withPermissions(List permissions) { + if (this.innerProperties() == null) { + this.innerProperties = new DenyAssignmentProperties(); + } + this.innerProperties().withPermissions(permissions); + return this; + } + + /** + * Get the scope property: The deny assignment scope. + * + * @return the scope value. + */ + public String scope() { + return this.innerProperties() == null ? null : this.innerProperties().scope(); + } + + /** + * Set the scope property: The deny assignment scope. + * + * @param scope the scope value to set. + * @return the DenyAssignmentInner object itself. + */ + public DenyAssignmentInner withScope(String scope) { + if (this.innerProperties() == null) { + this.innerProperties = new DenyAssignmentProperties(); + } + this.innerProperties().withScope(scope); + return this; + } + + /** + * Get the doNotApplyToChildScopes property: Determines if the deny assignment applies to child scopes. Default + * value is false. + * + * @return the doNotApplyToChildScopes value. + */ + public Boolean doNotApplyToChildScopes() { + return this.innerProperties() == null ? null : this.innerProperties().doNotApplyToChildScopes(); + } + + /** + * Set the doNotApplyToChildScopes property: Determines if the deny assignment applies to child scopes. Default + * value is false. + * + * @param doNotApplyToChildScopes the doNotApplyToChildScopes value to set. + * @return the DenyAssignmentInner object itself. + */ + public DenyAssignmentInner withDoNotApplyToChildScopes(Boolean doNotApplyToChildScopes) { + if (this.innerProperties() == null) { + this.innerProperties = new DenyAssignmentProperties(); + } + this.innerProperties().withDoNotApplyToChildScopes(doNotApplyToChildScopes); + return this; + } + + /** + * Get the principals property: Array of principals to which the deny assignment applies. + * + * @return the principals value. + */ + public List principals() { + return this.innerProperties() == null ? null : this.innerProperties().principals(); + } + + /** + * Set the principals property: Array of principals to which the deny assignment applies. + * + * @param principals the principals value to set. + * @return the DenyAssignmentInner object itself. + */ + public DenyAssignmentInner withPrincipals(List principals) { + if (this.innerProperties() == null) { + this.innerProperties = new DenyAssignmentProperties(); + } + this.innerProperties().withPrincipals(principals); + return this; + } + + /** + * Get the excludePrincipals property: Array of principals to which the deny assignment does not apply. + * + * @return the excludePrincipals value. + */ + public List excludePrincipals() { + return this.innerProperties() == null ? null : this.innerProperties().excludePrincipals(); + } + + /** + * Set the excludePrincipals property: Array of principals to which the deny assignment does not apply. + * + * @param excludePrincipals the excludePrincipals value to set. + * @return the DenyAssignmentInner object itself. + */ + public DenyAssignmentInner withExcludePrincipals(List excludePrincipals) { + if (this.innerProperties() == null) { + this.innerProperties = new DenyAssignmentProperties(); + } + this.innerProperties().withExcludePrincipals(excludePrincipals); + return this; + } + + /** + * Get the isSystemProtected property: Specifies whether this deny assignment was created by Azure and cannot be + * edited or deleted. + * + * @return the isSystemProtected value. + */ + public Boolean isSystemProtected() { + return this.innerProperties() == null ? null : this.innerProperties().isSystemProtected(); + } + + /** + * Set the isSystemProtected property: Specifies whether this deny assignment was created by Azure and cannot be + * edited or deleted. + * + * @param isSystemProtected the isSystemProtected value to set. + * @return the DenyAssignmentInner object itself. + */ + public DenyAssignmentInner withIsSystemProtected(Boolean isSystemProtected) { + if (this.innerProperties() == null) { + this.innerProperties = new DenyAssignmentProperties(); + } + this.innerProperties().withIsSystemProtected(isSystemProtected); + return this; + } + + /** + * Get the condition property: The conditions on the deny assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @return the condition value. + */ + public String condition() { + return this.innerProperties() == null ? null : this.innerProperties().condition(); + } + + /** + * Set the condition property: The conditions on the deny assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @param condition the condition value to set. + * @return the DenyAssignmentInner object itself. + */ + public DenyAssignmentInner withCondition(String condition) { + if (this.innerProperties() == null) { + this.innerProperties = new DenyAssignmentProperties(); + } + this.innerProperties().withCondition(condition); + return this; + } + + /** + * Get the conditionVersion property: Version of the condition. + * + * @return the conditionVersion value. + */ + public String conditionVersion() { + return this.innerProperties() == null ? null : this.innerProperties().conditionVersion(); + } + + /** + * Set the conditionVersion property: Version of the condition. + * + * @param conditionVersion the conditionVersion value to set. + * @return the DenyAssignmentInner object itself. + */ + public DenyAssignmentInner withConditionVersion(String conditionVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new DenyAssignmentProperties(); + } + this.innerProperties().withConditionVersion(conditionVersion); + return this; + } + + /** + * Get the createdOn property: Time it was created. + * + * @return the createdOn value. + */ + public OffsetDateTime createdOn() { + return this.innerProperties() == null ? null : this.innerProperties().createdOn(); + } + + /** + * Get the updatedOn property: Time it was updated. + * + * @return the updatedOn value. + */ + public OffsetDateTime updatedOn() { + return this.innerProperties() == null ? null : this.innerProperties().updatedOn(); + } + + /** + * Get the createdBy property: Id of the user who created the assignment. + * + * @return the createdBy value. + */ + public String createdBy() { + return this.innerProperties() == null ? null : this.innerProperties().createdBy(); + } + + /** + * Get the updatedBy property: Id of the user who updated the assignment. + * + * @return the updatedBy value. + */ + public String updatedBy() { + return this.innerProperties() == null ? null : this.innerProperties().updatedBy(); + } + + /** + * 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/DenyAssignmentProperties.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/DenyAssignmentProperties.java new file mode 100644 index 000000000000..5e2f3bd86c1f --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/DenyAssignmentProperties.java @@ -0,0 +1,367 @@ +// 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.DenyAssignmentPermission; +import com.azure.resourcemanager.authorization.generated.models.Principal; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Deny assignment properties. */ +@Fluent +public final class DenyAssignmentProperties { + /* + * The display name of the deny assignment. + */ + @JsonProperty(value = "denyAssignmentName") + private String denyAssignmentName; + + /* + * The description of the deny assignment. + */ + @JsonProperty(value = "description") + private String description; + + /* + * An array of permissions that are denied by the deny assignment. + */ + @JsonProperty(value = "permissions") + private List permissions; + + /* + * The deny assignment scope. + */ + @JsonProperty(value = "scope") + private String scope; + + /* + * Determines if the deny assignment applies to child scopes. Default value is false. + */ + @JsonProperty(value = "doNotApplyToChildScopes") + private Boolean doNotApplyToChildScopes; + + /* + * Array of principals to which the deny assignment applies. + */ + @JsonProperty(value = "principals") + private List principals; + + /* + * Array of principals to which the deny assignment does not apply. + */ + @JsonProperty(value = "excludePrincipals") + private List excludePrincipals; + + /* + * Specifies whether this deny assignment was created by Azure and cannot be edited or deleted. + */ + @JsonProperty(value = "isSystemProtected") + private Boolean isSystemProtected; + + /* + * The conditions on the deny assignment. This limits the resources it can be assigned to. e.g.: + * @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase + * 'foo_storage_container' + */ + @JsonProperty(value = "condition") + private String condition; + + /* + * Version of the condition. + */ + @JsonProperty(value = "conditionVersion") + private String conditionVersion; + + /* + * Time it was created + */ + @JsonProperty(value = "createdOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdOn; + + /* + * Time it was updated + */ + @JsonProperty(value = "updatedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime updatedOn; + + /* + * Id of the user who created the assignment + */ + @JsonProperty(value = "createdBy", access = JsonProperty.Access.WRITE_ONLY) + private String createdBy; + + /* + * Id of the user who updated the assignment + */ + @JsonProperty(value = "updatedBy", access = JsonProperty.Access.WRITE_ONLY) + private String updatedBy; + + /** Creates an instance of DenyAssignmentProperties class. */ + public DenyAssignmentProperties() { + } + + /** + * Get the denyAssignmentName property: The display name of the deny assignment. + * + * @return the denyAssignmentName value. + */ + public String denyAssignmentName() { + return this.denyAssignmentName; + } + + /** + * Set the denyAssignmentName property: The display name of the deny assignment. + * + * @param denyAssignmentName the denyAssignmentName value to set. + * @return the DenyAssignmentProperties object itself. + */ + public DenyAssignmentProperties withDenyAssignmentName(String denyAssignmentName) { + this.denyAssignmentName = denyAssignmentName; + return this; + } + + /** + * Get the description property: The description of the deny assignment. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the deny assignment. + * + * @param description the description value to set. + * @return the DenyAssignmentProperties object itself. + */ + public DenyAssignmentProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the permissions property: An array of permissions that are denied by the deny assignment. + * + * @return the permissions value. + */ + public List permissions() { + return this.permissions; + } + + /** + * Set the permissions property: An array of permissions that are denied by the deny assignment. + * + * @param permissions the permissions value to set. + * @return the DenyAssignmentProperties object itself. + */ + public DenyAssignmentProperties withPermissions(List permissions) { + this.permissions = permissions; + return this; + } + + /** + * Get the scope property: The deny assignment scope. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope property: The deny assignment scope. + * + * @param scope the scope value to set. + * @return the DenyAssignmentProperties object itself. + */ + public DenyAssignmentProperties withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the doNotApplyToChildScopes property: Determines if the deny assignment applies to child scopes. Default + * value is false. + * + * @return the doNotApplyToChildScopes value. + */ + public Boolean doNotApplyToChildScopes() { + return this.doNotApplyToChildScopes; + } + + /** + * Set the doNotApplyToChildScopes property: Determines if the deny assignment applies to child scopes. Default + * value is false. + * + * @param doNotApplyToChildScopes the doNotApplyToChildScopes value to set. + * @return the DenyAssignmentProperties object itself. + */ + public DenyAssignmentProperties withDoNotApplyToChildScopes(Boolean doNotApplyToChildScopes) { + this.doNotApplyToChildScopes = doNotApplyToChildScopes; + return this; + } + + /** + * Get the principals property: Array of principals to which the deny assignment applies. + * + * @return the principals value. + */ + public List principals() { + return this.principals; + } + + /** + * Set the principals property: Array of principals to which the deny assignment applies. + * + * @param principals the principals value to set. + * @return the DenyAssignmentProperties object itself. + */ + public DenyAssignmentProperties withPrincipals(List principals) { + this.principals = principals; + return this; + } + + /** + * Get the excludePrincipals property: Array of principals to which the deny assignment does not apply. + * + * @return the excludePrincipals value. + */ + public List excludePrincipals() { + return this.excludePrincipals; + } + + /** + * Set the excludePrincipals property: Array of principals to which the deny assignment does not apply. + * + * @param excludePrincipals the excludePrincipals value to set. + * @return the DenyAssignmentProperties object itself. + */ + public DenyAssignmentProperties withExcludePrincipals(List excludePrincipals) { + this.excludePrincipals = excludePrincipals; + return this; + } + + /** + * Get the isSystemProtected property: Specifies whether this deny assignment was created by Azure and cannot be + * edited or deleted. + * + * @return the isSystemProtected value. + */ + public Boolean isSystemProtected() { + return this.isSystemProtected; + } + + /** + * Set the isSystemProtected property: Specifies whether this deny assignment was created by Azure and cannot be + * edited or deleted. + * + * @param isSystemProtected the isSystemProtected value to set. + * @return the DenyAssignmentProperties object itself. + */ + public DenyAssignmentProperties withIsSystemProtected(Boolean isSystemProtected) { + this.isSystemProtected = isSystemProtected; + return this; + } + + /** + * Get the condition property: The conditions on the deny assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @return the condition value. + */ + public String condition() { + return this.condition; + } + + /** + * Set the condition property: The conditions on the deny assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @param condition the condition value to set. + * @return the DenyAssignmentProperties object itself. + */ + public DenyAssignmentProperties withCondition(String condition) { + this.condition = condition; + return this; + } + + /** + * Get the conditionVersion property: Version of the condition. + * + * @return the conditionVersion value. + */ + public String conditionVersion() { + return this.conditionVersion; + } + + /** + * Set the conditionVersion property: Version of the condition. + * + * @param conditionVersion the conditionVersion value to set. + * @return the DenyAssignmentProperties object itself. + */ + public DenyAssignmentProperties withConditionVersion(String conditionVersion) { + this.conditionVersion = conditionVersion; + return this; + } + + /** + * Get the createdOn property: Time it was created. + * + * @return the createdOn value. + */ + public OffsetDateTime createdOn() { + return this.createdOn; + } + + /** + * Get the updatedOn property: Time it was updated. + * + * @return the updatedOn value. + */ + public OffsetDateTime updatedOn() { + return this.updatedOn; + } + + /** + * Get the createdBy property: Id of the user who created the assignment. + * + * @return the createdBy value. + */ + public String createdBy() { + return this.createdBy; + } + + /** + * Get the updatedBy property: Id of the user who updated the assignment. + * + * @return the updatedBy value. + */ + public String updatedBy() { + return this.updatedBy; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (permissions() != null) { + permissions().forEach(e -> e.validate()); + } + if (principals() != null) { + principals().forEach(e -> e.validate()); + } + if (excludePrincipals() != null) { + excludePrincipals().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/EligibleChildResourceInner.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/EligibleChildResourceInner.java new file mode 100644 index 000000000000..9fe337528b7c --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/EligibleChildResourceInner.java @@ -0,0 +1,69 @@ +// 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; + +/** Eligible child resource. */ +@Immutable +public final class EligibleChildResourceInner { + /* + * The resource scope Id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The resource name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** Creates an instance of EligibleChildResourceInner class. */ + public EligibleChildResourceInner() { + } + + /** + * Get the id property: The resource scope Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: The resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * 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 000000000000..fa6a17168fde --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/OperationInner.java @@ -0,0 +1,132 @@ +// 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; + + /** Creates an instance of OperationInner class. */ + public OperationInner() { + } + + /** + * 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/PermissionInner.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/PermissionInner.java new file mode 100644 index 000000000000..2074f4db54cd --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/PermissionInner.java @@ -0,0 +1,163 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Role definition permissions. */ +@Fluent +public final class PermissionInner { + /* + * Allowed actions. + */ + @JsonProperty(value = "actions") + private List actions; + + /* + * Denied actions. + */ + @JsonProperty(value = "notActions") + private List notActions; + + /* + * Allowed Data actions. + */ + @JsonProperty(value = "dataActions") + private List dataActions; + + /* + * Denied Data actions. + */ + @JsonProperty(value = "notDataActions") + private List notDataActions; + + /* + * The conditions on the role definition. This limits the resources it can be assigned to. e.g.: + * @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase + * 'foo_storage_container' + */ + @JsonProperty(value = "condition", access = JsonProperty.Access.WRITE_ONLY) + private String condition; + + /* + * Version of the condition. Currently the only accepted value is '2.0' + */ + @JsonProperty(value = "conditionVersion", access = JsonProperty.Access.WRITE_ONLY) + private String conditionVersion; + + /** Creates an instance of PermissionInner class. */ + public PermissionInner() { + } + + /** + * Get the actions property: Allowed actions. + * + * @return the actions value. + */ + public List actions() { + return this.actions; + } + + /** + * Set the actions property: Allowed actions. + * + * @param actions the actions value to set. + * @return the PermissionInner object itself. + */ + public PermissionInner withActions(List actions) { + this.actions = actions; + return this; + } + + /** + * Get the notActions property: Denied actions. + * + * @return the notActions value. + */ + public List notActions() { + return this.notActions; + } + + /** + * Set the notActions property: Denied actions. + * + * @param notActions the notActions value to set. + * @return the PermissionInner object itself. + */ + public PermissionInner withNotActions(List notActions) { + this.notActions = notActions; + return this; + } + + /** + * Get the dataActions property: Allowed Data actions. + * + * @return the dataActions value. + */ + public List dataActions() { + return this.dataActions; + } + + /** + * Set the dataActions property: Allowed Data actions. + * + * @param dataActions the dataActions value to set. + * @return the PermissionInner object itself. + */ + public PermissionInner withDataActions(List dataActions) { + this.dataActions = dataActions; + return this; + } + + /** + * Get the notDataActions property: Denied Data actions. + * + * @return the notDataActions value. + */ + public List notDataActions() { + return this.notDataActions; + } + + /** + * Set the notDataActions property: Denied Data actions. + * + * @param notDataActions the notDataActions value to set. + * @return the PermissionInner object itself. + */ + public PermissionInner withNotDataActions(List notDataActions) { + this.notDataActions = notDataActions; + return this; + } + + /** + * Get the condition property: The conditions on the role definition. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @return the condition value. + */ + public String condition() { + return this.condition; + } + + /** + * Get the conditionVersion property: Version of the condition. Currently the only accepted value is '2.0'. + * + * @return the conditionVersion value. + */ + public String conditionVersion() { + return this.conditionVersion; + } + + /** + * 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/ProviderOperationsMetadataInner.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/ProviderOperationsMetadataInner.java new file mode 100644 index 000000000000..bdc1c3de3101 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/ProviderOperationsMetadataInner.java @@ -0,0 +1,189 @@ +// 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.ProviderOperation; +import com.azure.resourcemanager.authorization.generated.models.ResourceType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Provider Operations metadata. */ +@Fluent +public final class ProviderOperationsMetadataInner { + /* + * The provider id. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The provider name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The provider type. + */ + @JsonProperty(value = "type") + private String type; + + /* + * The provider display name. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * The provider resource types + */ + @JsonProperty(value = "resourceTypes") + private List resourceTypes; + + /* + * The provider operations. + */ + @JsonProperty(value = "operations") + private List operations; + + /** Creates an instance of ProviderOperationsMetadataInner class. */ + public ProviderOperationsMetadataInner() { + } + + /** + * Get the id property: The provider id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The provider id. + * + * @param id the id value to set. + * @return the ProviderOperationsMetadataInner object itself. + */ + public ProviderOperationsMetadataInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: The provider name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The provider name. + * + * @param name the name value to set. + * @return the ProviderOperationsMetadataInner object itself. + */ + public ProviderOperationsMetadataInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The provider type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The provider type. + * + * @param type the type value to set. + * @return the ProviderOperationsMetadataInner object itself. + */ + public ProviderOperationsMetadataInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get the displayName property: The provider display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The provider display name. + * + * @param displayName the displayName value to set. + * @return the ProviderOperationsMetadataInner object itself. + */ + public ProviderOperationsMetadataInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the resourceTypes property: The provider resource types. + * + * @return the resourceTypes value. + */ + public List resourceTypes() { + return this.resourceTypes; + } + + /** + * Set the resourceTypes property: The provider resource types. + * + * @param resourceTypes the resourceTypes value to set. + * @return the ProviderOperationsMetadataInner object itself. + */ + public ProviderOperationsMetadataInner withResourceTypes(List resourceTypes) { + this.resourceTypes = resourceTypes; + return this; + } + + /** + * Get the operations property: The provider operations. + * + * @return the operations value. + */ + public List operations() { + return this.operations; + } + + /** + * Set the operations property: The provider operations. + * + * @param operations the operations value to set. + * @return the ProviderOperationsMetadataInner object itself. + */ + public ProviderOperationsMetadataInner withOperations(List operations) { + this.operations = operations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourceTypes() != null) { + resourceTypes().forEach(e -> e.validate()); + } + if (operations() != null) { + operations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleAssignmentInner.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleAssignmentInner.java new file mode 100644 index 000000000000..aab09cef8eec --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleAssignmentInner.java @@ -0,0 +1,255 @@ +// 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.PrincipalType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Role Assignments. */ +@Fluent +public final class RoleAssignmentInner extends ProxyResource { + /* + * Role assignment properties. + */ + @JsonProperty(value = "properties") + private RoleAssignmentProperties innerProperties; + + /** Creates an instance of RoleAssignmentInner class. */ + public RoleAssignmentInner() { + } + + /** + * Get the innerProperties property: Role assignment properties. + * + * @return the innerProperties value. + */ + private RoleAssignmentProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the scope property: The role assignment scope. + * + * @return the scope value. + */ + public String scope() { + return this.innerProperties() == null ? null : this.innerProperties().scope(); + } + + /** + * Get the roleDefinitionId property: The role definition ID. + * + * @return the roleDefinitionId value. + */ + public String roleDefinitionId() { + return this.innerProperties() == null ? null : this.innerProperties().roleDefinitionId(); + } + + /** + * Set the roleDefinitionId property: The role definition ID. + * + * @param roleDefinitionId the roleDefinitionId value to set. + * @return the RoleAssignmentInner object itself. + */ + public RoleAssignmentInner withRoleDefinitionId(String roleDefinitionId) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentProperties(); + } + this.innerProperties().withRoleDefinitionId(roleDefinitionId); + return this; + } + + /** + * Get the principalId property: The principal ID. + * + * @return the principalId value. + */ + public String principalId() { + return this.innerProperties() == null ? null : this.innerProperties().principalId(); + } + + /** + * Set the principalId property: The principal ID. + * + * @param principalId the principalId value to set. + * @return the RoleAssignmentInner object itself. + */ + public RoleAssignmentInner withPrincipalId(String principalId) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentProperties(); + } + this.innerProperties().withPrincipalId(principalId); + return this; + } + + /** + * Get the principalType property: The principal type of the assigned principal ID. + * + * @return the principalType value. + */ + public PrincipalType principalType() { + return this.innerProperties() == null ? null : this.innerProperties().principalType(); + } + + /** + * Set the principalType property: The principal type of the assigned principal ID. + * + * @param principalType the principalType value to set. + * @return the RoleAssignmentInner object itself. + */ + public RoleAssignmentInner withPrincipalType(PrincipalType principalType) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentProperties(); + } + this.innerProperties().withPrincipalType(principalType); + return this; + } + + /** + * Get the description property: Description of role assignment. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: Description of role assignment. + * + * @param description the description value to set. + * @return the RoleAssignmentInner object itself. + */ + public RoleAssignmentInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the condition property: The conditions on the role assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @return the condition value. + */ + public String condition() { + return this.innerProperties() == null ? null : this.innerProperties().condition(); + } + + /** + * Set the condition property: The conditions on the role assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @param condition the condition value to set. + * @return the RoleAssignmentInner object itself. + */ + public RoleAssignmentInner withCondition(String condition) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentProperties(); + } + this.innerProperties().withCondition(condition); + return this; + } + + /** + * Get the conditionVersion property: Version of the condition. Currently the only accepted value is '2.0'. + * + * @return the conditionVersion value. + */ + public String conditionVersion() { + return this.innerProperties() == null ? null : this.innerProperties().conditionVersion(); + } + + /** + * Set the conditionVersion property: Version of the condition. Currently the only accepted value is '2.0'. + * + * @param conditionVersion the conditionVersion value to set. + * @return the RoleAssignmentInner object itself. + */ + public RoleAssignmentInner withConditionVersion(String conditionVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentProperties(); + } + this.innerProperties().withConditionVersion(conditionVersion); + return this; + } + + /** + * Get the createdOn property: Time it was created. + * + * @return the createdOn value. + */ + public OffsetDateTime createdOn() { + return this.innerProperties() == null ? null : this.innerProperties().createdOn(); + } + + /** + * Get the updatedOn property: Time it was updated. + * + * @return the updatedOn value. + */ + public OffsetDateTime updatedOn() { + return this.innerProperties() == null ? null : this.innerProperties().updatedOn(); + } + + /** + * Get the createdBy property: Id of the user who created the assignment. + * + * @return the createdBy value. + */ + public String createdBy() { + return this.innerProperties() == null ? null : this.innerProperties().createdBy(); + } + + /** + * Get the updatedBy property: Id of the user who updated the assignment. + * + * @return the updatedBy value. + */ + public String updatedBy() { + return this.innerProperties() == null ? null : this.innerProperties().updatedBy(); + } + + /** + * Get the delegatedManagedIdentityResourceId property: Id of the delegated managed identity resource. + * + * @return the delegatedManagedIdentityResourceId value. + */ + public String delegatedManagedIdentityResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().delegatedManagedIdentityResourceId(); + } + + /** + * Set the delegatedManagedIdentityResourceId property: Id of the delegated managed identity resource. + * + * @param delegatedManagedIdentityResourceId the delegatedManagedIdentityResourceId value to set. + * @return the RoleAssignmentInner object itself. + */ + public RoleAssignmentInner withDelegatedManagedIdentityResourceId(String delegatedManagedIdentityResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentProperties(); + } + this.innerProperties().withDelegatedManagedIdentityResourceId(delegatedManagedIdentityResourceId); + 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/RoleAssignmentProperties.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleAssignmentProperties.java new file mode 100644 index 000000000000..55acb7d9a72f --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleAssignmentProperties.java @@ -0,0 +1,304 @@ +// 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.PrincipalType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Role assignment properties. */ +@Fluent +public final class RoleAssignmentProperties { + /* + * The role assignment scope. + */ + @JsonProperty(value = "scope", access = JsonProperty.Access.WRITE_ONLY) + private String scope; + + /* + * The role definition ID. + */ + @JsonProperty(value = "roleDefinitionId", required = true) + private String roleDefinitionId; + + /* + * The principal ID. + */ + @JsonProperty(value = "principalId", required = true) + private String principalId; + + /* + * The principal type of the assigned principal ID. + */ + @JsonProperty(value = "principalType") + private PrincipalType principalType; + + /* + * Description of role assignment + */ + @JsonProperty(value = "description") + private String description; + + /* + * The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: + * @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase + * 'foo_storage_container' + */ + @JsonProperty(value = "condition") + private String condition; + + /* + * Version of the condition. Currently the only accepted value is '2.0' + */ + @JsonProperty(value = "conditionVersion") + private String conditionVersion; + + /* + * Time it was created + */ + @JsonProperty(value = "createdOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdOn; + + /* + * Time it was updated + */ + @JsonProperty(value = "updatedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime updatedOn; + + /* + * Id of the user who created the assignment + */ + @JsonProperty(value = "createdBy", access = JsonProperty.Access.WRITE_ONLY) + private String createdBy; + + /* + * Id of the user who updated the assignment + */ + @JsonProperty(value = "updatedBy", access = JsonProperty.Access.WRITE_ONLY) + private String updatedBy; + + /* + * Id of the delegated managed identity resource + */ + @JsonProperty(value = "delegatedManagedIdentityResourceId") + private String delegatedManagedIdentityResourceId; + + /** Creates an instance of RoleAssignmentProperties class. */ + public RoleAssignmentProperties() { + } + + /** + * Get the scope property: The role assignment scope. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Get the roleDefinitionId property: The role definition ID. + * + * @return the roleDefinitionId value. + */ + public String roleDefinitionId() { + return this.roleDefinitionId; + } + + /** + * Set the roleDefinitionId property: The role definition ID. + * + * @param roleDefinitionId the roleDefinitionId value to set. + * @return the RoleAssignmentProperties object itself. + */ + public RoleAssignmentProperties withRoleDefinitionId(String roleDefinitionId) { + this.roleDefinitionId = roleDefinitionId; + return this; + } + + /** + * Get the principalId property: The principal ID. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: The principal ID. + * + * @param principalId the principalId value to set. + * @return the RoleAssignmentProperties object itself. + */ + public RoleAssignmentProperties withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the principalType property: The principal type of the assigned principal ID. + * + * @return the principalType value. + */ + public PrincipalType principalType() { + return this.principalType; + } + + /** + * Set the principalType property: The principal type of the assigned principal ID. + * + * @param principalType the principalType value to set. + * @return the RoleAssignmentProperties object itself. + */ + public RoleAssignmentProperties withPrincipalType(PrincipalType principalType) { + this.principalType = principalType; + return this; + } + + /** + * Get the description property: Description of role assignment. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of role assignment. + * + * @param description the description value to set. + * @return the RoleAssignmentProperties object itself. + */ + public RoleAssignmentProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the condition property: The conditions on the role assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @return the condition value. + */ + public String condition() { + return this.condition; + } + + /** + * Set the condition property: The conditions on the role assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @param condition the condition value to set. + * @return the RoleAssignmentProperties object itself. + */ + public RoleAssignmentProperties withCondition(String condition) { + this.condition = condition; + return this; + } + + /** + * Get the conditionVersion property: Version of the condition. Currently the only accepted value is '2.0'. + * + * @return the conditionVersion value. + */ + public String conditionVersion() { + return this.conditionVersion; + } + + /** + * Set the conditionVersion property: Version of the condition. Currently the only accepted value is '2.0'. + * + * @param conditionVersion the conditionVersion value to set. + * @return the RoleAssignmentProperties object itself. + */ + public RoleAssignmentProperties withConditionVersion(String conditionVersion) { + this.conditionVersion = conditionVersion; + return this; + } + + /** + * Get the createdOn property: Time it was created. + * + * @return the createdOn value. + */ + public OffsetDateTime createdOn() { + return this.createdOn; + } + + /** + * Get the updatedOn property: Time it was updated. + * + * @return the updatedOn value. + */ + public OffsetDateTime updatedOn() { + return this.updatedOn; + } + + /** + * Get the createdBy property: Id of the user who created the assignment. + * + * @return the createdBy value. + */ + public String createdBy() { + return this.createdBy; + } + + /** + * Get the updatedBy property: Id of the user who updated the assignment. + * + * @return the updatedBy value. + */ + public String updatedBy() { + return this.updatedBy; + } + + /** + * Get the delegatedManagedIdentityResourceId property: Id of the delegated managed identity resource. + * + * @return the delegatedManagedIdentityResourceId value. + */ + public String delegatedManagedIdentityResourceId() { + return this.delegatedManagedIdentityResourceId; + } + + /** + * Set the delegatedManagedIdentityResourceId property: Id of the delegated managed identity resource. + * + * @param delegatedManagedIdentityResourceId the delegatedManagedIdentityResourceId value to set. + * @return the RoleAssignmentProperties object itself. + */ + public RoleAssignmentProperties withDelegatedManagedIdentityResourceId(String delegatedManagedIdentityResourceId) { + this.delegatedManagedIdentityResourceId = delegatedManagedIdentityResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (roleDefinitionId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property roleDefinitionId in model RoleAssignmentProperties")); + } + if (principalId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property principalId in model RoleAssignmentProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RoleAssignmentProperties.class); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleAssignmentScheduleInner.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleAssignmentScheduleInner.java new file mode 100644 index 000000000000..721e9a21e5cd --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleAssignmentScheduleInner.java @@ -0,0 +1,469 @@ +// 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.AssignmentType; +import com.azure.resourcemanager.authorization.generated.models.ExpandedProperties; +import com.azure.resourcemanager.authorization.generated.models.MemberType; +import com.azure.resourcemanager.authorization.generated.models.PrincipalType; +import com.azure.resourcemanager.authorization.generated.models.Status; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Role Assignment schedule. */ +@Fluent +public final class RoleAssignmentScheduleInner { + /* + * The role assignment schedule Id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The role assignment schedule name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The role assignment schedule type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Role assignment schedule properties. + */ + @JsonProperty(value = "properties") + private RoleAssignmentScheduleProperties innerProperties; + + /** Creates an instance of RoleAssignmentScheduleInner class. */ + public RoleAssignmentScheduleInner() { + } + + /** + * Get the id property: The role assignment schedule Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The role assignment schedule name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: The role assignment schedule type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the innerProperties property: Role assignment schedule properties. + * + * @return the innerProperties value. + */ + private RoleAssignmentScheduleProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the scope property: The role assignment schedule scope. + * + * @return the scope value. + */ + public String scope() { + return this.innerProperties() == null ? null : this.innerProperties().scope(); + } + + /** + * Set the scope property: The role assignment schedule scope. + * + * @param scope the scope value to set. + * @return the RoleAssignmentScheduleInner object itself. + */ + public RoleAssignmentScheduleInner withScope(String scope) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleProperties(); + } + this.innerProperties().withScope(scope); + return this; + } + + /** + * Get the roleDefinitionId property: The role definition ID. + * + * @return the roleDefinitionId value. + */ + public String roleDefinitionId() { + return this.innerProperties() == null ? null : this.innerProperties().roleDefinitionId(); + } + + /** + * Set the roleDefinitionId property: The role definition ID. + * + * @param roleDefinitionId the roleDefinitionId value to set. + * @return the RoleAssignmentScheduleInner object itself. + */ + public RoleAssignmentScheduleInner withRoleDefinitionId(String roleDefinitionId) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleProperties(); + } + this.innerProperties().withRoleDefinitionId(roleDefinitionId); + return this; + } + + /** + * Get the principalId property: The principal ID. + * + * @return the principalId value. + */ + public String principalId() { + return this.innerProperties() == null ? null : this.innerProperties().principalId(); + } + + /** + * Set the principalId property: The principal ID. + * + * @param principalId the principalId value to set. + * @return the RoleAssignmentScheduleInner object itself. + */ + public RoleAssignmentScheduleInner withPrincipalId(String principalId) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleProperties(); + } + this.innerProperties().withPrincipalId(principalId); + return this; + } + + /** + * Get the principalType property: The principal type of the assigned principal ID. + * + * @return the principalType value. + */ + public PrincipalType principalType() { + return this.innerProperties() == null ? null : this.innerProperties().principalType(); + } + + /** + * Set the principalType property: The principal type of the assigned principal ID. + * + * @param principalType the principalType value to set. + * @return the RoleAssignmentScheduleInner object itself. + */ + public RoleAssignmentScheduleInner withPrincipalType(PrincipalType principalType) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleProperties(); + } + this.innerProperties().withPrincipalType(principalType); + return this; + } + + /** + * Get the roleAssignmentScheduleRequestId property: The id of roleAssignmentScheduleRequest used to create this + * roleAssignmentSchedule. + * + * @return the roleAssignmentScheduleRequestId value. + */ + public String roleAssignmentScheduleRequestId() { + return this.innerProperties() == null ? null : this.innerProperties().roleAssignmentScheduleRequestId(); + } + + /** + * Set the roleAssignmentScheduleRequestId property: The id of roleAssignmentScheduleRequest used to create this + * roleAssignmentSchedule. + * + * @param roleAssignmentScheduleRequestId the roleAssignmentScheduleRequestId value to set. + * @return the RoleAssignmentScheduleInner object itself. + */ + public RoleAssignmentScheduleInner withRoleAssignmentScheduleRequestId(String roleAssignmentScheduleRequestId) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleProperties(); + } + this.innerProperties().withRoleAssignmentScheduleRequestId(roleAssignmentScheduleRequestId); + return this; + } + + /** + * Get the linkedRoleEligibilityScheduleId property: The id of roleEligibilitySchedule used to activated this + * roleAssignmentSchedule. + * + * @return the linkedRoleEligibilityScheduleId value. + */ + public String linkedRoleEligibilityScheduleId() { + return this.innerProperties() == null ? null : this.innerProperties().linkedRoleEligibilityScheduleId(); + } + + /** + * Set the linkedRoleEligibilityScheduleId property: The id of roleEligibilitySchedule used to activated this + * roleAssignmentSchedule. + * + * @param linkedRoleEligibilityScheduleId the linkedRoleEligibilityScheduleId value to set. + * @return the RoleAssignmentScheduleInner object itself. + */ + public RoleAssignmentScheduleInner withLinkedRoleEligibilityScheduleId(String linkedRoleEligibilityScheduleId) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleProperties(); + } + this.innerProperties().withLinkedRoleEligibilityScheduleId(linkedRoleEligibilityScheduleId); + return this; + } + + /** + * Get the assignmentType property: Assignment type of the role assignment schedule. + * + * @return the assignmentType value. + */ + public AssignmentType assignmentType() { + return this.innerProperties() == null ? null : this.innerProperties().assignmentType(); + } + + /** + * Set the assignmentType property: Assignment type of the role assignment schedule. + * + * @param assignmentType the assignmentType value to set. + * @return the RoleAssignmentScheduleInner object itself. + */ + public RoleAssignmentScheduleInner withAssignmentType(AssignmentType assignmentType) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleProperties(); + } + this.innerProperties().withAssignmentType(assignmentType); + return this; + } + + /** + * Get the memberType property: Membership type of the role assignment schedule. + * + * @return the memberType value. + */ + public MemberType memberType() { + return this.innerProperties() == null ? null : this.innerProperties().memberType(); + } + + /** + * Set the memberType property: Membership type of the role assignment schedule. + * + * @param memberType the memberType value to set. + * @return the RoleAssignmentScheduleInner object itself. + */ + public RoleAssignmentScheduleInner withMemberType(MemberType memberType) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleProperties(); + } + this.innerProperties().withMemberType(memberType); + return this; + } + + /** + * Get the status property: The status of the role assignment schedule. + * + * @return the status value. + */ + public Status status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: The status of the role assignment schedule. + * + * @param status the status value to set. + * @return the RoleAssignmentScheduleInner object itself. + */ + public RoleAssignmentScheduleInner withStatus(Status status) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Get the startDateTime property: Start DateTime when role assignment schedule. + * + * @return the startDateTime value. + */ + public OffsetDateTime startDateTime() { + return this.innerProperties() == null ? null : this.innerProperties().startDateTime(); + } + + /** + * Set the startDateTime property: Start DateTime when role assignment schedule. + * + * @param startDateTime the startDateTime value to set. + * @return the RoleAssignmentScheduleInner object itself. + */ + public RoleAssignmentScheduleInner withStartDateTime(OffsetDateTime startDateTime) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleProperties(); + } + this.innerProperties().withStartDateTime(startDateTime); + return this; + } + + /** + * Get the endDateTime property: End DateTime when role assignment schedule. + * + * @return the endDateTime value. + */ + public OffsetDateTime endDateTime() { + return this.innerProperties() == null ? null : this.innerProperties().endDateTime(); + } + + /** + * Set the endDateTime property: End DateTime when role assignment schedule. + * + * @param endDateTime the endDateTime value to set. + * @return the RoleAssignmentScheduleInner object itself. + */ + public RoleAssignmentScheduleInner withEndDateTime(OffsetDateTime endDateTime) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleProperties(); + } + this.innerProperties().withEndDateTime(endDateTime); + return this; + } + + /** + * Get the condition property: The conditions on the role assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @return the condition value. + */ + public String condition() { + return this.innerProperties() == null ? null : this.innerProperties().condition(); + } + + /** + * Set the condition property: The conditions on the role assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @param condition the condition value to set. + * @return the RoleAssignmentScheduleInner object itself. + */ + public RoleAssignmentScheduleInner withCondition(String condition) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleProperties(); + } + this.innerProperties().withCondition(condition); + return this; + } + + /** + * Get the conditionVersion property: Version of the condition. Currently accepted value is '2.0'. + * + * @return the conditionVersion value. + */ + public String conditionVersion() { + return this.innerProperties() == null ? null : this.innerProperties().conditionVersion(); + } + + /** + * Set the conditionVersion property: Version of the condition. Currently accepted value is '2.0'. + * + * @param conditionVersion the conditionVersion value to set. + * @return the RoleAssignmentScheduleInner object itself. + */ + public RoleAssignmentScheduleInner withConditionVersion(String conditionVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleProperties(); + } + this.innerProperties().withConditionVersion(conditionVersion); + return this; + } + + /** + * Get the createdOn property: DateTime when role assignment schedule was created. + * + * @return the createdOn value. + */ + public OffsetDateTime createdOn() { + return this.innerProperties() == null ? null : this.innerProperties().createdOn(); + } + + /** + * Set the createdOn property: DateTime when role assignment schedule was created. + * + * @param createdOn the createdOn value to set. + * @return the RoleAssignmentScheduleInner object itself. + */ + public RoleAssignmentScheduleInner withCreatedOn(OffsetDateTime createdOn) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleProperties(); + } + this.innerProperties().withCreatedOn(createdOn); + return this; + } + + /** + * Get the updatedOn property: DateTime when role assignment schedule was modified. + * + * @return the updatedOn value. + */ + public OffsetDateTime updatedOn() { + return this.innerProperties() == null ? null : this.innerProperties().updatedOn(); + } + + /** + * Set the updatedOn property: DateTime when role assignment schedule was modified. + * + * @param updatedOn the updatedOn value to set. + * @return the RoleAssignmentScheduleInner object itself. + */ + public RoleAssignmentScheduleInner withUpdatedOn(OffsetDateTime updatedOn) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleProperties(); + } + this.innerProperties().withUpdatedOn(updatedOn); + return this; + } + + /** + * Get the expandedProperties property: Additional properties of principal, scope and role definition. + * + * @return the expandedProperties value. + */ + public ExpandedProperties expandedProperties() { + return this.innerProperties() == null ? null : this.innerProperties().expandedProperties(); + } + + /** + * Set the expandedProperties property: Additional properties of principal, scope and role definition. + * + * @param expandedProperties the expandedProperties value to set. + * @return the RoleAssignmentScheduleInner object itself. + */ + public RoleAssignmentScheduleInner withExpandedProperties(ExpandedProperties expandedProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleProperties(); + } + this.innerProperties().withExpandedProperties(expandedProperties); + 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/RoleAssignmentScheduleInstanceInner.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleAssignmentScheduleInstanceInner.java new file mode 100644 index 000000000000..e15a355331a7 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleAssignmentScheduleInstanceInner.java @@ -0,0 +1,492 @@ +// 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.AssignmentType; +import com.azure.resourcemanager.authorization.generated.models.ExpandedProperties; +import com.azure.resourcemanager.authorization.generated.models.MemberType; +import com.azure.resourcemanager.authorization.generated.models.PrincipalType; +import com.azure.resourcemanager.authorization.generated.models.Status; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Information about current or upcoming role assignment schedule instance. */ +@Fluent +public final class RoleAssignmentScheduleInstanceInner { + /* + * The role assignment schedule instance ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The role assignment schedule instance name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The role assignment schedule instance type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Role assignment schedule instance properties. + */ + @JsonProperty(value = "properties") + private RoleAssignmentScheduleInstanceProperties innerProperties; + + /** Creates an instance of RoleAssignmentScheduleInstanceInner class. */ + public RoleAssignmentScheduleInstanceInner() { + } + + /** + * Get the id property: The role assignment schedule instance ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The role assignment schedule instance name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: The role assignment schedule instance type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the innerProperties property: Role assignment schedule instance properties. + * + * @return the innerProperties value. + */ + private RoleAssignmentScheduleInstanceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the scope property: The role assignment schedule scope. + * + * @return the scope value. + */ + public String scope() { + return this.innerProperties() == null ? null : this.innerProperties().scope(); + } + + /** + * Set the scope property: The role assignment schedule scope. + * + * @param scope the scope value to set. + * @return the RoleAssignmentScheduleInstanceInner object itself. + */ + public RoleAssignmentScheduleInstanceInner withScope(String scope) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleInstanceProperties(); + } + this.innerProperties().withScope(scope); + return this; + } + + /** + * Get the roleDefinitionId property: The role definition ID. + * + * @return the roleDefinitionId value. + */ + public String roleDefinitionId() { + return this.innerProperties() == null ? null : this.innerProperties().roleDefinitionId(); + } + + /** + * Set the roleDefinitionId property: The role definition ID. + * + * @param roleDefinitionId the roleDefinitionId value to set. + * @return the RoleAssignmentScheduleInstanceInner object itself. + */ + public RoleAssignmentScheduleInstanceInner withRoleDefinitionId(String roleDefinitionId) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleInstanceProperties(); + } + this.innerProperties().withRoleDefinitionId(roleDefinitionId); + return this; + } + + /** + * Get the principalId property: The principal ID. + * + * @return the principalId value. + */ + public String principalId() { + return this.innerProperties() == null ? null : this.innerProperties().principalId(); + } + + /** + * Set the principalId property: The principal ID. + * + * @param principalId the principalId value to set. + * @return the RoleAssignmentScheduleInstanceInner object itself. + */ + public RoleAssignmentScheduleInstanceInner withPrincipalId(String principalId) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleInstanceProperties(); + } + this.innerProperties().withPrincipalId(principalId); + return this; + } + + /** + * Get the principalType property: The principal type of the assigned principal ID. + * + * @return the principalType value. + */ + public PrincipalType principalType() { + return this.innerProperties() == null ? null : this.innerProperties().principalType(); + } + + /** + * Set the principalType property: The principal type of the assigned principal ID. + * + * @param principalType the principalType value to set. + * @return the RoleAssignmentScheduleInstanceInner object itself. + */ + public RoleAssignmentScheduleInstanceInner withPrincipalType(PrincipalType principalType) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleInstanceProperties(); + } + this.innerProperties().withPrincipalType(principalType); + return this; + } + + /** + * Get the roleAssignmentScheduleId property: Id of the master role assignment schedule. + * + * @return the roleAssignmentScheduleId value. + */ + public String roleAssignmentScheduleId() { + return this.innerProperties() == null ? null : this.innerProperties().roleAssignmentScheduleId(); + } + + /** + * Set the roleAssignmentScheduleId property: Id of the master role assignment schedule. + * + * @param roleAssignmentScheduleId the roleAssignmentScheduleId value to set. + * @return the RoleAssignmentScheduleInstanceInner object itself. + */ + public RoleAssignmentScheduleInstanceInner withRoleAssignmentScheduleId(String roleAssignmentScheduleId) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleInstanceProperties(); + } + this.innerProperties().withRoleAssignmentScheduleId(roleAssignmentScheduleId); + return this; + } + + /** + * Get the originRoleAssignmentId property: Role Assignment Id in external system. + * + * @return the originRoleAssignmentId value. + */ + public String originRoleAssignmentId() { + return this.innerProperties() == null ? null : this.innerProperties().originRoleAssignmentId(); + } + + /** + * Set the originRoleAssignmentId property: Role Assignment Id in external system. + * + * @param originRoleAssignmentId the originRoleAssignmentId value to set. + * @return the RoleAssignmentScheduleInstanceInner object itself. + */ + public RoleAssignmentScheduleInstanceInner withOriginRoleAssignmentId(String originRoleAssignmentId) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleInstanceProperties(); + } + this.innerProperties().withOriginRoleAssignmentId(originRoleAssignmentId); + return this; + } + + /** + * Get the status property: The status of the role assignment schedule instance. + * + * @return the status value. + */ + public Status status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: The status of the role assignment schedule instance. + * + * @param status the status value to set. + * @return the RoleAssignmentScheduleInstanceInner object itself. + */ + public RoleAssignmentScheduleInstanceInner withStatus(Status status) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleInstanceProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Get the startDateTime property: The startDateTime of the role assignment schedule instance. + * + * @return the startDateTime value. + */ + public OffsetDateTime startDateTime() { + return this.innerProperties() == null ? null : this.innerProperties().startDateTime(); + } + + /** + * Set the startDateTime property: The startDateTime of the role assignment schedule instance. + * + * @param startDateTime the startDateTime value to set. + * @return the RoleAssignmentScheduleInstanceInner object itself. + */ + public RoleAssignmentScheduleInstanceInner withStartDateTime(OffsetDateTime startDateTime) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleInstanceProperties(); + } + this.innerProperties().withStartDateTime(startDateTime); + return this; + } + + /** + * Get the endDateTime property: The endDateTime of the role assignment schedule instance. + * + * @return the endDateTime value. + */ + public OffsetDateTime endDateTime() { + return this.innerProperties() == null ? null : this.innerProperties().endDateTime(); + } + + /** + * Set the endDateTime property: The endDateTime of the role assignment schedule instance. + * + * @param endDateTime the endDateTime value to set. + * @return the RoleAssignmentScheduleInstanceInner object itself. + */ + public RoleAssignmentScheduleInstanceInner withEndDateTime(OffsetDateTime endDateTime) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleInstanceProperties(); + } + this.innerProperties().withEndDateTime(endDateTime); + return this; + } + + /** + * Get the linkedRoleEligibilityScheduleId property: roleEligibilityScheduleId used to activate. + * + * @return the linkedRoleEligibilityScheduleId value. + */ + public String linkedRoleEligibilityScheduleId() { + return this.innerProperties() == null ? null : this.innerProperties().linkedRoleEligibilityScheduleId(); + } + + /** + * Set the linkedRoleEligibilityScheduleId property: roleEligibilityScheduleId used to activate. + * + * @param linkedRoleEligibilityScheduleId the linkedRoleEligibilityScheduleId value to set. + * @return the RoleAssignmentScheduleInstanceInner object itself. + */ + public RoleAssignmentScheduleInstanceInner withLinkedRoleEligibilityScheduleId( + String linkedRoleEligibilityScheduleId) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleInstanceProperties(); + } + this.innerProperties().withLinkedRoleEligibilityScheduleId(linkedRoleEligibilityScheduleId); + return this; + } + + /** + * Get the linkedRoleEligibilityScheduleInstanceId property: roleEligibilityScheduleInstanceId linked to this + * roleAssignmentScheduleInstance. + * + * @return the linkedRoleEligibilityScheduleInstanceId value. + */ + public String linkedRoleEligibilityScheduleInstanceId() { + return this.innerProperties() == null ? null : this.innerProperties().linkedRoleEligibilityScheduleInstanceId(); + } + + /** + * Set the linkedRoleEligibilityScheduleInstanceId property: roleEligibilityScheduleInstanceId linked to this + * roleAssignmentScheduleInstance. + * + * @param linkedRoleEligibilityScheduleInstanceId the linkedRoleEligibilityScheduleInstanceId value to set. + * @return the RoleAssignmentScheduleInstanceInner object itself. + */ + public RoleAssignmentScheduleInstanceInner withLinkedRoleEligibilityScheduleInstanceId( + String linkedRoleEligibilityScheduleInstanceId) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleInstanceProperties(); + } + this.innerProperties().withLinkedRoleEligibilityScheduleInstanceId(linkedRoleEligibilityScheduleInstanceId); + return this; + } + + /** + * Get the assignmentType property: Assignment type of the role assignment schedule. + * + * @return the assignmentType value. + */ + public AssignmentType assignmentType() { + return this.innerProperties() == null ? null : this.innerProperties().assignmentType(); + } + + /** + * Set the assignmentType property: Assignment type of the role assignment schedule. + * + * @param assignmentType the assignmentType value to set. + * @return the RoleAssignmentScheduleInstanceInner object itself. + */ + public RoleAssignmentScheduleInstanceInner withAssignmentType(AssignmentType assignmentType) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleInstanceProperties(); + } + this.innerProperties().withAssignmentType(assignmentType); + return this; + } + + /** + * Get the memberType property: Membership type of the role assignment schedule. + * + * @return the memberType value. + */ + public MemberType memberType() { + return this.innerProperties() == null ? null : this.innerProperties().memberType(); + } + + /** + * Set the memberType property: Membership type of the role assignment schedule. + * + * @param memberType the memberType value to set. + * @return the RoleAssignmentScheduleInstanceInner object itself. + */ + public RoleAssignmentScheduleInstanceInner withMemberType(MemberType memberType) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleInstanceProperties(); + } + this.innerProperties().withMemberType(memberType); + return this; + } + + /** + * Get the condition property: The conditions on the role assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @return the condition value. + */ + public String condition() { + return this.innerProperties() == null ? null : this.innerProperties().condition(); + } + + /** + * Set the condition property: The conditions on the role assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @param condition the condition value to set. + * @return the RoleAssignmentScheduleInstanceInner object itself. + */ + public RoleAssignmentScheduleInstanceInner withCondition(String condition) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleInstanceProperties(); + } + this.innerProperties().withCondition(condition); + return this; + } + + /** + * Get the conditionVersion property: Version of the condition. Currently accepted value is '2.0'. + * + * @return the conditionVersion value. + */ + public String conditionVersion() { + return this.innerProperties() == null ? null : this.innerProperties().conditionVersion(); + } + + /** + * Set the conditionVersion property: Version of the condition. Currently accepted value is '2.0'. + * + * @param conditionVersion the conditionVersion value to set. + * @return the RoleAssignmentScheduleInstanceInner object itself. + */ + public RoleAssignmentScheduleInstanceInner withConditionVersion(String conditionVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleInstanceProperties(); + } + this.innerProperties().withConditionVersion(conditionVersion); + return this; + } + + /** + * Get the createdOn property: DateTime when role assignment schedule was created. + * + * @return the createdOn value. + */ + public OffsetDateTime createdOn() { + return this.innerProperties() == null ? null : this.innerProperties().createdOn(); + } + + /** + * Set the createdOn property: DateTime when role assignment schedule was created. + * + * @param createdOn the createdOn value to set. + * @return the RoleAssignmentScheduleInstanceInner object itself. + */ + public RoleAssignmentScheduleInstanceInner withCreatedOn(OffsetDateTime createdOn) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleInstanceProperties(); + } + this.innerProperties().withCreatedOn(createdOn); + return this; + } + + /** + * Get the expandedProperties property: Additional properties of principal, scope and role definition. + * + * @return the expandedProperties value. + */ + public ExpandedProperties expandedProperties() { + return this.innerProperties() == null ? null : this.innerProperties().expandedProperties(); + } + + /** + * Set the expandedProperties property: Additional properties of principal, scope and role definition. + * + * @param expandedProperties the expandedProperties value to set. + * @return the RoleAssignmentScheduleInstanceInner object itself. + */ + public RoleAssignmentScheduleInstanceInner withExpandedProperties(ExpandedProperties expandedProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleInstanceProperties(); + } + this.innerProperties().withExpandedProperties(expandedProperties); + 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/RoleAssignmentScheduleInstanceProperties.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleAssignmentScheduleInstanceProperties.java new file mode 100644 index 000000000000..e0c6a484e7e0 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleAssignmentScheduleInstanceProperties.java @@ -0,0 +1,485 @@ +// 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.AssignmentType; +import com.azure.resourcemanager.authorization.generated.models.ExpandedProperties; +import com.azure.resourcemanager.authorization.generated.models.MemberType; +import com.azure.resourcemanager.authorization.generated.models.PrincipalType; +import com.azure.resourcemanager.authorization.generated.models.Status; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Role assignment schedule properties with scope. */ +@Fluent +public final class RoleAssignmentScheduleInstanceProperties { + /* + * The role assignment schedule scope. + */ + @JsonProperty(value = "scope") + private String scope; + + /* + * The role definition ID. + */ + @JsonProperty(value = "roleDefinitionId") + private String roleDefinitionId; + + /* + * The principal ID. + */ + @JsonProperty(value = "principalId") + private String principalId; + + /* + * The principal type of the assigned principal ID. + */ + @JsonProperty(value = "principalType") + private PrincipalType principalType; + + /* + * Id of the master role assignment schedule + */ + @JsonProperty(value = "roleAssignmentScheduleId") + private String roleAssignmentScheduleId; + + /* + * Role Assignment Id in external system + */ + @JsonProperty(value = "originRoleAssignmentId") + private String originRoleAssignmentId; + + /* + * The status of the role assignment schedule instance. + */ + @JsonProperty(value = "status") + private Status status; + + /* + * The startDateTime of the role assignment schedule instance + */ + @JsonProperty(value = "startDateTime") + private OffsetDateTime startDateTime; + + /* + * The endDateTime of the role assignment schedule instance + */ + @JsonProperty(value = "endDateTime") + private OffsetDateTime endDateTime; + + /* + * roleEligibilityScheduleId used to activate + */ + @JsonProperty(value = "linkedRoleEligibilityScheduleId") + private String linkedRoleEligibilityScheduleId; + + /* + * roleEligibilityScheduleInstanceId linked to this roleAssignmentScheduleInstance + */ + @JsonProperty(value = "linkedRoleEligibilityScheduleInstanceId") + private String linkedRoleEligibilityScheduleInstanceId; + + /* + * Assignment type of the role assignment schedule + */ + @JsonProperty(value = "assignmentType") + private AssignmentType assignmentType; + + /* + * Membership type of the role assignment schedule + */ + @JsonProperty(value = "memberType") + private MemberType memberType; + + /* + * The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: + * @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase + * 'foo_storage_container' + */ + @JsonProperty(value = "condition") + private String condition; + + /* + * Version of the condition. Currently accepted value is '2.0' + */ + @JsonProperty(value = "conditionVersion") + private String conditionVersion; + + /* + * DateTime when role assignment schedule was created + */ + @JsonProperty(value = "createdOn") + private OffsetDateTime createdOn; + + /* + * Additional properties of principal, scope and role definition + */ + @JsonProperty(value = "expandedProperties") + private ExpandedProperties expandedProperties; + + /** Creates an instance of RoleAssignmentScheduleInstanceProperties class. */ + public RoleAssignmentScheduleInstanceProperties() { + } + + /** + * Get the scope property: The role assignment schedule scope. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope property: The role assignment schedule scope. + * + * @param scope the scope value to set. + * @return the RoleAssignmentScheduleInstanceProperties object itself. + */ + public RoleAssignmentScheduleInstanceProperties withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the roleDefinitionId property: The role definition ID. + * + * @return the roleDefinitionId value. + */ + public String roleDefinitionId() { + return this.roleDefinitionId; + } + + /** + * Set the roleDefinitionId property: The role definition ID. + * + * @param roleDefinitionId the roleDefinitionId value to set. + * @return the RoleAssignmentScheduleInstanceProperties object itself. + */ + public RoleAssignmentScheduleInstanceProperties withRoleDefinitionId(String roleDefinitionId) { + this.roleDefinitionId = roleDefinitionId; + return this; + } + + /** + * Get the principalId property: The principal ID. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: The principal ID. + * + * @param principalId the principalId value to set. + * @return the RoleAssignmentScheduleInstanceProperties object itself. + */ + public RoleAssignmentScheduleInstanceProperties withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the principalType property: The principal type of the assigned principal ID. + * + * @return the principalType value. + */ + public PrincipalType principalType() { + return this.principalType; + } + + /** + * Set the principalType property: The principal type of the assigned principal ID. + * + * @param principalType the principalType value to set. + * @return the RoleAssignmentScheduleInstanceProperties object itself. + */ + public RoleAssignmentScheduleInstanceProperties withPrincipalType(PrincipalType principalType) { + this.principalType = principalType; + return this; + } + + /** + * Get the roleAssignmentScheduleId property: Id of the master role assignment schedule. + * + * @return the roleAssignmentScheduleId value. + */ + public String roleAssignmentScheduleId() { + return this.roleAssignmentScheduleId; + } + + /** + * Set the roleAssignmentScheduleId property: Id of the master role assignment schedule. + * + * @param roleAssignmentScheduleId the roleAssignmentScheduleId value to set. + * @return the RoleAssignmentScheduleInstanceProperties object itself. + */ + public RoleAssignmentScheduleInstanceProperties withRoleAssignmentScheduleId(String roleAssignmentScheduleId) { + this.roleAssignmentScheduleId = roleAssignmentScheduleId; + return this; + } + + /** + * Get the originRoleAssignmentId property: Role Assignment Id in external system. + * + * @return the originRoleAssignmentId value. + */ + public String originRoleAssignmentId() { + return this.originRoleAssignmentId; + } + + /** + * Set the originRoleAssignmentId property: Role Assignment Id in external system. + * + * @param originRoleAssignmentId the originRoleAssignmentId value to set. + * @return the RoleAssignmentScheduleInstanceProperties object itself. + */ + public RoleAssignmentScheduleInstanceProperties withOriginRoleAssignmentId(String originRoleAssignmentId) { + this.originRoleAssignmentId = originRoleAssignmentId; + return this; + } + + /** + * Get the status property: The status of the role assignment schedule instance. + * + * @return the status value. + */ + public Status status() { + return this.status; + } + + /** + * Set the status property: The status of the role assignment schedule instance. + * + * @param status the status value to set. + * @return the RoleAssignmentScheduleInstanceProperties object itself. + */ + public RoleAssignmentScheduleInstanceProperties withStatus(Status status) { + this.status = status; + return this; + } + + /** + * Get the startDateTime property: The startDateTime of the role assignment schedule instance. + * + * @return the startDateTime value. + */ + public OffsetDateTime startDateTime() { + return this.startDateTime; + } + + /** + * Set the startDateTime property: The startDateTime of the role assignment schedule instance. + * + * @param startDateTime the startDateTime value to set. + * @return the RoleAssignmentScheduleInstanceProperties object itself. + */ + public RoleAssignmentScheduleInstanceProperties withStartDateTime(OffsetDateTime startDateTime) { + this.startDateTime = startDateTime; + return this; + } + + /** + * Get the endDateTime property: The endDateTime of the role assignment schedule instance. + * + * @return the endDateTime value. + */ + public OffsetDateTime endDateTime() { + return this.endDateTime; + } + + /** + * Set the endDateTime property: The endDateTime of the role assignment schedule instance. + * + * @param endDateTime the endDateTime value to set. + * @return the RoleAssignmentScheduleInstanceProperties object itself. + */ + public RoleAssignmentScheduleInstanceProperties withEndDateTime(OffsetDateTime endDateTime) { + this.endDateTime = endDateTime; + return this; + } + + /** + * Get the linkedRoleEligibilityScheduleId property: roleEligibilityScheduleId used to activate. + * + * @return the linkedRoleEligibilityScheduleId value. + */ + public String linkedRoleEligibilityScheduleId() { + return this.linkedRoleEligibilityScheduleId; + } + + /** + * Set the linkedRoleEligibilityScheduleId property: roleEligibilityScheduleId used to activate. + * + * @param linkedRoleEligibilityScheduleId the linkedRoleEligibilityScheduleId value to set. + * @return the RoleAssignmentScheduleInstanceProperties object itself. + */ + public RoleAssignmentScheduleInstanceProperties withLinkedRoleEligibilityScheduleId( + String linkedRoleEligibilityScheduleId) { + this.linkedRoleEligibilityScheduleId = linkedRoleEligibilityScheduleId; + return this; + } + + /** + * Get the linkedRoleEligibilityScheduleInstanceId property: roleEligibilityScheduleInstanceId linked to this + * roleAssignmentScheduleInstance. + * + * @return the linkedRoleEligibilityScheduleInstanceId value. + */ + public String linkedRoleEligibilityScheduleInstanceId() { + return this.linkedRoleEligibilityScheduleInstanceId; + } + + /** + * Set the linkedRoleEligibilityScheduleInstanceId property: roleEligibilityScheduleInstanceId linked to this + * roleAssignmentScheduleInstance. + * + * @param linkedRoleEligibilityScheduleInstanceId the linkedRoleEligibilityScheduleInstanceId value to set. + * @return the RoleAssignmentScheduleInstanceProperties object itself. + */ + public RoleAssignmentScheduleInstanceProperties withLinkedRoleEligibilityScheduleInstanceId( + String linkedRoleEligibilityScheduleInstanceId) { + this.linkedRoleEligibilityScheduleInstanceId = linkedRoleEligibilityScheduleInstanceId; + return this; + } + + /** + * Get the assignmentType property: Assignment type of the role assignment schedule. + * + * @return the assignmentType value. + */ + public AssignmentType assignmentType() { + return this.assignmentType; + } + + /** + * Set the assignmentType property: Assignment type of the role assignment schedule. + * + * @param assignmentType the assignmentType value to set. + * @return the RoleAssignmentScheduleInstanceProperties object itself. + */ + public RoleAssignmentScheduleInstanceProperties withAssignmentType(AssignmentType assignmentType) { + this.assignmentType = assignmentType; + return this; + } + + /** + * Get the memberType property: Membership type of the role assignment schedule. + * + * @return the memberType value. + */ + public MemberType memberType() { + return this.memberType; + } + + /** + * Set the memberType property: Membership type of the role assignment schedule. + * + * @param memberType the memberType value to set. + * @return the RoleAssignmentScheduleInstanceProperties object itself. + */ + public RoleAssignmentScheduleInstanceProperties withMemberType(MemberType memberType) { + this.memberType = memberType; + return this; + } + + /** + * Get the condition property: The conditions on the role assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @return the condition value. + */ + public String condition() { + return this.condition; + } + + /** + * Set the condition property: The conditions on the role assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @param condition the condition value to set. + * @return the RoleAssignmentScheduleInstanceProperties object itself. + */ + public RoleAssignmentScheduleInstanceProperties withCondition(String condition) { + this.condition = condition; + return this; + } + + /** + * Get the conditionVersion property: Version of the condition. Currently accepted value is '2.0'. + * + * @return the conditionVersion value. + */ + public String conditionVersion() { + return this.conditionVersion; + } + + /** + * Set the conditionVersion property: Version of the condition. Currently accepted value is '2.0'. + * + * @param conditionVersion the conditionVersion value to set. + * @return the RoleAssignmentScheduleInstanceProperties object itself. + */ + public RoleAssignmentScheduleInstanceProperties withConditionVersion(String conditionVersion) { + this.conditionVersion = conditionVersion; + return this; + } + + /** + * Get the createdOn property: DateTime when role assignment schedule was created. + * + * @return the createdOn value. + */ + public OffsetDateTime createdOn() { + return this.createdOn; + } + + /** + * Set the createdOn property: DateTime when role assignment schedule was created. + * + * @param createdOn the createdOn value to set. + * @return the RoleAssignmentScheduleInstanceProperties object itself. + */ + public RoleAssignmentScheduleInstanceProperties withCreatedOn(OffsetDateTime createdOn) { + this.createdOn = createdOn; + return this; + } + + /** + * Get the expandedProperties property: Additional properties of principal, scope and role definition. + * + * @return the expandedProperties value. + */ + public ExpandedProperties expandedProperties() { + return this.expandedProperties; + } + + /** + * Set the expandedProperties property: Additional properties of principal, scope and role definition. + * + * @param expandedProperties the expandedProperties value to set. + * @return the RoleAssignmentScheduleInstanceProperties object itself. + */ + public RoleAssignmentScheduleInstanceProperties withExpandedProperties(ExpandedProperties expandedProperties) { + this.expandedProperties = expandedProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (expandedProperties() != null) { + expandedProperties().validate(); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleAssignmentScheduleProperties.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleAssignmentScheduleProperties.java new file mode 100644 index 000000000000..97c5449b3147 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleAssignmentScheduleProperties.java @@ -0,0 +1,461 @@ +// 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.AssignmentType; +import com.azure.resourcemanager.authorization.generated.models.ExpandedProperties; +import com.azure.resourcemanager.authorization.generated.models.MemberType; +import com.azure.resourcemanager.authorization.generated.models.PrincipalType; +import com.azure.resourcemanager.authorization.generated.models.Status; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Role assignment schedule properties with scope. */ +@Fluent +public final class RoleAssignmentScheduleProperties { + /* + * The role assignment schedule scope. + */ + @JsonProperty(value = "scope") + private String scope; + + /* + * The role definition ID. + */ + @JsonProperty(value = "roleDefinitionId") + private String roleDefinitionId; + + /* + * The principal ID. + */ + @JsonProperty(value = "principalId") + private String principalId; + + /* + * The principal type of the assigned principal ID. + */ + @JsonProperty(value = "principalType") + private PrincipalType principalType; + + /* + * The id of roleAssignmentScheduleRequest used to create this roleAssignmentSchedule + */ + @JsonProperty(value = "roleAssignmentScheduleRequestId") + private String roleAssignmentScheduleRequestId; + + /* + * The id of roleEligibilitySchedule used to activated this roleAssignmentSchedule + */ + @JsonProperty(value = "linkedRoleEligibilityScheduleId") + private String linkedRoleEligibilityScheduleId; + + /* + * Assignment type of the role assignment schedule + */ + @JsonProperty(value = "assignmentType") + private AssignmentType assignmentType; + + /* + * Membership type of the role assignment schedule + */ + @JsonProperty(value = "memberType") + private MemberType memberType; + + /* + * The status of the role assignment schedule. + */ + @JsonProperty(value = "status") + private Status status; + + /* + * Start DateTime when role assignment schedule + */ + @JsonProperty(value = "startDateTime") + private OffsetDateTime startDateTime; + + /* + * End DateTime when role assignment schedule + */ + @JsonProperty(value = "endDateTime") + private OffsetDateTime endDateTime; + + /* + * The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: + * @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase + * 'foo_storage_container' + */ + @JsonProperty(value = "condition") + private String condition; + + /* + * Version of the condition. Currently accepted value is '2.0' + */ + @JsonProperty(value = "conditionVersion") + private String conditionVersion; + + /* + * DateTime when role assignment schedule was created + */ + @JsonProperty(value = "createdOn") + private OffsetDateTime createdOn; + + /* + * DateTime when role assignment schedule was modified + */ + @JsonProperty(value = "updatedOn") + private OffsetDateTime updatedOn; + + /* + * Additional properties of principal, scope and role definition + */ + @JsonProperty(value = "expandedProperties") + private ExpandedProperties expandedProperties; + + /** Creates an instance of RoleAssignmentScheduleProperties class. */ + public RoleAssignmentScheduleProperties() { + } + + /** + * Get the scope property: The role assignment schedule scope. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope property: The role assignment schedule scope. + * + * @param scope the scope value to set. + * @return the RoleAssignmentScheduleProperties object itself. + */ + public RoleAssignmentScheduleProperties withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the roleDefinitionId property: The role definition ID. + * + * @return the roleDefinitionId value. + */ + public String roleDefinitionId() { + return this.roleDefinitionId; + } + + /** + * Set the roleDefinitionId property: The role definition ID. + * + * @param roleDefinitionId the roleDefinitionId value to set. + * @return the RoleAssignmentScheduleProperties object itself. + */ + public RoleAssignmentScheduleProperties withRoleDefinitionId(String roleDefinitionId) { + this.roleDefinitionId = roleDefinitionId; + return this; + } + + /** + * Get the principalId property: The principal ID. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: The principal ID. + * + * @param principalId the principalId value to set. + * @return the RoleAssignmentScheduleProperties object itself. + */ + public RoleAssignmentScheduleProperties withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the principalType property: The principal type of the assigned principal ID. + * + * @return the principalType value. + */ + public PrincipalType principalType() { + return this.principalType; + } + + /** + * Set the principalType property: The principal type of the assigned principal ID. + * + * @param principalType the principalType value to set. + * @return the RoleAssignmentScheduleProperties object itself. + */ + public RoleAssignmentScheduleProperties withPrincipalType(PrincipalType principalType) { + this.principalType = principalType; + return this; + } + + /** + * Get the roleAssignmentScheduleRequestId property: The id of roleAssignmentScheduleRequest used to create this + * roleAssignmentSchedule. + * + * @return the roleAssignmentScheduleRequestId value. + */ + public String roleAssignmentScheduleRequestId() { + return this.roleAssignmentScheduleRequestId; + } + + /** + * Set the roleAssignmentScheduleRequestId property: The id of roleAssignmentScheduleRequest used to create this + * roleAssignmentSchedule. + * + * @param roleAssignmentScheduleRequestId the roleAssignmentScheduleRequestId value to set. + * @return the RoleAssignmentScheduleProperties object itself. + */ + public RoleAssignmentScheduleProperties withRoleAssignmentScheduleRequestId( + String roleAssignmentScheduleRequestId) { + this.roleAssignmentScheduleRequestId = roleAssignmentScheduleRequestId; + return this; + } + + /** + * Get the linkedRoleEligibilityScheduleId property: The id of roleEligibilitySchedule used to activated this + * roleAssignmentSchedule. + * + * @return the linkedRoleEligibilityScheduleId value. + */ + public String linkedRoleEligibilityScheduleId() { + return this.linkedRoleEligibilityScheduleId; + } + + /** + * Set the linkedRoleEligibilityScheduleId property: The id of roleEligibilitySchedule used to activated this + * roleAssignmentSchedule. + * + * @param linkedRoleEligibilityScheduleId the linkedRoleEligibilityScheduleId value to set. + * @return the RoleAssignmentScheduleProperties object itself. + */ + public RoleAssignmentScheduleProperties withLinkedRoleEligibilityScheduleId( + String linkedRoleEligibilityScheduleId) { + this.linkedRoleEligibilityScheduleId = linkedRoleEligibilityScheduleId; + return this; + } + + /** + * Get the assignmentType property: Assignment type of the role assignment schedule. + * + * @return the assignmentType value. + */ + public AssignmentType assignmentType() { + return this.assignmentType; + } + + /** + * Set the assignmentType property: Assignment type of the role assignment schedule. + * + * @param assignmentType the assignmentType value to set. + * @return the RoleAssignmentScheduleProperties object itself. + */ + public RoleAssignmentScheduleProperties withAssignmentType(AssignmentType assignmentType) { + this.assignmentType = assignmentType; + return this; + } + + /** + * Get the memberType property: Membership type of the role assignment schedule. + * + * @return the memberType value. + */ + public MemberType memberType() { + return this.memberType; + } + + /** + * Set the memberType property: Membership type of the role assignment schedule. + * + * @param memberType the memberType value to set. + * @return the RoleAssignmentScheduleProperties object itself. + */ + public RoleAssignmentScheduleProperties withMemberType(MemberType memberType) { + this.memberType = memberType; + return this; + } + + /** + * Get the status property: The status of the role assignment schedule. + * + * @return the status value. + */ + public Status status() { + return this.status; + } + + /** + * Set the status property: The status of the role assignment schedule. + * + * @param status the status value to set. + * @return the RoleAssignmentScheduleProperties object itself. + */ + public RoleAssignmentScheduleProperties withStatus(Status status) { + this.status = status; + return this; + } + + /** + * Get the startDateTime property: Start DateTime when role assignment schedule. + * + * @return the startDateTime value. + */ + public OffsetDateTime startDateTime() { + return this.startDateTime; + } + + /** + * Set the startDateTime property: Start DateTime when role assignment schedule. + * + * @param startDateTime the startDateTime value to set. + * @return the RoleAssignmentScheduleProperties object itself. + */ + public RoleAssignmentScheduleProperties withStartDateTime(OffsetDateTime startDateTime) { + this.startDateTime = startDateTime; + return this; + } + + /** + * Get the endDateTime property: End DateTime when role assignment schedule. + * + * @return the endDateTime value. + */ + public OffsetDateTime endDateTime() { + return this.endDateTime; + } + + /** + * Set the endDateTime property: End DateTime when role assignment schedule. + * + * @param endDateTime the endDateTime value to set. + * @return the RoleAssignmentScheduleProperties object itself. + */ + public RoleAssignmentScheduleProperties withEndDateTime(OffsetDateTime endDateTime) { + this.endDateTime = endDateTime; + return this; + } + + /** + * Get the condition property: The conditions on the role assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @return the condition value. + */ + public String condition() { + return this.condition; + } + + /** + * Set the condition property: The conditions on the role assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @param condition the condition value to set. + * @return the RoleAssignmentScheduleProperties object itself. + */ + public RoleAssignmentScheduleProperties withCondition(String condition) { + this.condition = condition; + return this; + } + + /** + * Get the conditionVersion property: Version of the condition. Currently accepted value is '2.0'. + * + * @return the conditionVersion value. + */ + public String conditionVersion() { + return this.conditionVersion; + } + + /** + * Set the conditionVersion property: Version of the condition. Currently accepted value is '2.0'. + * + * @param conditionVersion the conditionVersion value to set. + * @return the RoleAssignmentScheduleProperties object itself. + */ + public RoleAssignmentScheduleProperties withConditionVersion(String conditionVersion) { + this.conditionVersion = conditionVersion; + return this; + } + + /** + * Get the createdOn property: DateTime when role assignment schedule was created. + * + * @return the createdOn value. + */ + public OffsetDateTime createdOn() { + return this.createdOn; + } + + /** + * Set the createdOn property: DateTime when role assignment schedule was created. + * + * @param createdOn the createdOn value to set. + * @return the RoleAssignmentScheduleProperties object itself. + */ + public RoleAssignmentScheduleProperties withCreatedOn(OffsetDateTime createdOn) { + this.createdOn = createdOn; + return this; + } + + /** + * Get the updatedOn property: DateTime when role assignment schedule was modified. + * + * @return the updatedOn value. + */ + public OffsetDateTime updatedOn() { + return this.updatedOn; + } + + /** + * Set the updatedOn property: DateTime when role assignment schedule was modified. + * + * @param updatedOn the updatedOn value to set. + * @return the RoleAssignmentScheduleProperties object itself. + */ + public RoleAssignmentScheduleProperties withUpdatedOn(OffsetDateTime updatedOn) { + this.updatedOn = updatedOn; + return this; + } + + /** + * Get the expandedProperties property: Additional properties of principal, scope and role definition. + * + * @return the expandedProperties value. + */ + public ExpandedProperties expandedProperties() { + return this.expandedProperties; + } + + /** + * Set the expandedProperties property: Additional properties of principal, scope and role definition. + * + * @param expandedProperties the expandedProperties value to set. + * @return the RoleAssignmentScheduleProperties object itself. + */ + public RoleAssignmentScheduleProperties withExpandedProperties(ExpandedProperties expandedProperties) { + this.expandedProperties = expandedProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (expandedProperties() != null) { + expandedProperties().validate(); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleAssignmentScheduleRequestInner.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleAssignmentScheduleRequestInner.java new file mode 100644 index 000000000000..fbc7e9300dfa --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleAssignmentScheduleRequestInner.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.ExpandedProperties; +import com.azure.resourcemanager.authorization.generated.models.PrincipalType; +import com.azure.resourcemanager.authorization.generated.models.RequestType; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignmentScheduleRequestPropertiesScheduleInfo; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignmentScheduleRequestPropertiesTicketInfo; +import com.azure.resourcemanager.authorization.generated.models.Status; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Role Assignment schedule request. */ +@Fluent +public final class RoleAssignmentScheduleRequestInner { + /* + * The role assignment schedule request ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The role assignment schedule request name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The role assignment schedule request type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Role assignment schedule request properties. + */ + @JsonProperty(value = "properties") + private RoleAssignmentScheduleRequestProperties innerProperties; + + /** Creates an instance of RoleAssignmentScheduleRequestInner class. */ + public RoleAssignmentScheduleRequestInner() { + } + + /** + * Get the id property: The role assignment schedule request ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The role assignment schedule request name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: The role assignment schedule request type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the innerProperties property: Role assignment schedule request properties. + * + * @return the innerProperties value. + */ + private RoleAssignmentScheduleRequestProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the scope property: The role assignment schedule request scope. + * + * @return the scope value. + */ + public String scope() { + return this.innerProperties() == null ? null : this.innerProperties().scope(); + } + + /** + * Get the roleDefinitionId property: The role definition ID. + * + * @return the roleDefinitionId value. + */ + public String roleDefinitionId() { + return this.innerProperties() == null ? null : this.innerProperties().roleDefinitionId(); + } + + /** + * Set the roleDefinitionId property: The role definition ID. + * + * @param roleDefinitionId the roleDefinitionId value to set. + * @return the RoleAssignmentScheduleRequestInner object itself. + */ + public RoleAssignmentScheduleRequestInner withRoleDefinitionId(String roleDefinitionId) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleRequestProperties(); + } + this.innerProperties().withRoleDefinitionId(roleDefinitionId); + return this; + } + + /** + * Get the principalId property: The principal ID. + * + * @return the principalId value. + */ + public String principalId() { + return this.innerProperties() == null ? null : this.innerProperties().principalId(); + } + + /** + * Set the principalId property: The principal ID. + * + * @param principalId the principalId value to set. + * @return the RoleAssignmentScheduleRequestInner object itself. + */ + public RoleAssignmentScheduleRequestInner withPrincipalId(String principalId) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleRequestProperties(); + } + this.innerProperties().withPrincipalId(principalId); + return this; + } + + /** + * Get the principalType property: The principal type of the assigned principal ID. + * + * @return the principalType value. + */ + public PrincipalType principalType() { + return this.innerProperties() == null ? null : this.innerProperties().principalType(); + } + + /** + * Get the requestType property: The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign + * etc. + * + * @return the requestType value. + */ + public RequestType requestType() { + return this.innerProperties() == null ? null : this.innerProperties().requestType(); + } + + /** + * Set the requestType property: The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign + * etc. + * + * @param requestType the requestType value to set. + * @return the RoleAssignmentScheduleRequestInner object itself. + */ + public RoleAssignmentScheduleRequestInner withRequestType(RequestType requestType) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleRequestProperties(); + } + this.innerProperties().withRequestType(requestType); + return this; + } + + /** + * Get the status property: The status of the role assignment schedule request. + * + * @return the status value. + */ + public Status status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the approvalId property: The approvalId of the role assignment schedule request. + * + * @return the approvalId value. + */ + public String approvalId() { + return this.innerProperties() == null ? null : this.innerProperties().approvalId(); + } + + /** + * Get the targetRoleAssignmentScheduleId property: The resultant role assignment schedule id or the role assignment + * schedule id being updated. + * + * @return the targetRoleAssignmentScheduleId value. + */ + public String targetRoleAssignmentScheduleId() { + return this.innerProperties() == null ? null : this.innerProperties().targetRoleAssignmentScheduleId(); + } + + /** + * Set the targetRoleAssignmentScheduleId property: The resultant role assignment schedule id or the role assignment + * schedule id being updated. + * + * @param targetRoleAssignmentScheduleId the targetRoleAssignmentScheduleId value to set. + * @return the RoleAssignmentScheduleRequestInner object itself. + */ + public RoleAssignmentScheduleRequestInner withTargetRoleAssignmentScheduleId( + String targetRoleAssignmentScheduleId) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleRequestProperties(); + } + this.innerProperties().withTargetRoleAssignmentScheduleId(targetRoleAssignmentScheduleId); + return this; + } + + /** + * Get the targetRoleAssignmentScheduleInstanceId property: The role assignment schedule instance id being updated. + * + * @return the targetRoleAssignmentScheduleInstanceId value. + */ + public String targetRoleAssignmentScheduleInstanceId() { + return this.innerProperties() == null ? null : this.innerProperties().targetRoleAssignmentScheduleInstanceId(); + } + + /** + * Set the targetRoleAssignmentScheduleInstanceId property: The role assignment schedule instance id being updated. + * + * @param targetRoleAssignmentScheduleInstanceId the targetRoleAssignmentScheduleInstanceId value to set. + * @return the RoleAssignmentScheduleRequestInner object itself. + */ + public RoleAssignmentScheduleRequestInner withTargetRoleAssignmentScheduleInstanceId( + String targetRoleAssignmentScheduleInstanceId) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleRequestProperties(); + } + this.innerProperties().withTargetRoleAssignmentScheduleInstanceId(targetRoleAssignmentScheduleInstanceId); + return this; + } + + /** + * Get the scheduleInfo property: Schedule info of the role assignment schedule. + * + * @return the scheduleInfo value. + */ + public RoleAssignmentScheduleRequestPropertiesScheduleInfo scheduleInfo() { + return this.innerProperties() == null ? null : this.innerProperties().scheduleInfo(); + } + + /** + * Set the scheduleInfo property: Schedule info of the role assignment schedule. + * + * @param scheduleInfo the scheduleInfo value to set. + * @return the RoleAssignmentScheduleRequestInner object itself. + */ + public RoleAssignmentScheduleRequestInner withScheduleInfo( + RoleAssignmentScheduleRequestPropertiesScheduleInfo scheduleInfo) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleRequestProperties(); + } + this.innerProperties().withScheduleInfo(scheduleInfo); + return this; + } + + /** + * Get the linkedRoleEligibilityScheduleId property: The linked role eligibility schedule id - to activate an + * eligibility. + * + * @return the linkedRoleEligibilityScheduleId value. + */ + public String linkedRoleEligibilityScheduleId() { + return this.innerProperties() == null ? null : this.innerProperties().linkedRoleEligibilityScheduleId(); + } + + /** + * Set the linkedRoleEligibilityScheduleId property: The linked role eligibility schedule id - to activate an + * eligibility. + * + * @param linkedRoleEligibilityScheduleId the linkedRoleEligibilityScheduleId value to set. + * @return the RoleAssignmentScheduleRequestInner object itself. + */ + public RoleAssignmentScheduleRequestInner withLinkedRoleEligibilityScheduleId( + String linkedRoleEligibilityScheduleId) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleRequestProperties(); + } + this.innerProperties().withLinkedRoleEligibilityScheduleId(linkedRoleEligibilityScheduleId); + return this; + } + + /** + * Get the justification property: Justification for the role assignment. + * + * @return the justification value. + */ + public String justification() { + return this.innerProperties() == null ? null : this.innerProperties().justification(); + } + + /** + * Set the justification property: Justification for the role assignment. + * + * @param justification the justification value to set. + * @return the RoleAssignmentScheduleRequestInner object itself. + */ + public RoleAssignmentScheduleRequestInner withJustification(String justification) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleRequestProperties(); + } + this.innerProperties().withJustification(justification); + return this; + } + + /** + * Get the ticketInfo property: Ticket Info of the role assignment. + * + * @return the ticketInfo value. + */ + public RoleAssignmentScheduleRequestPropertiesTicketInfo ticketInfo() { + return this.innerProperties() == null ? null : this.innerProperties().ticketInfo(); + } + + /** + * Set the ticketInfo property: Ticket Info of the role assignment. + * + * @param ticketInfo the ticketInfo value to set. + * @return the RoleAssignmentScheduleRequestInner object itself. + */ + public RoleAssignmentScheduleRequestInner withTicketInfo( + RoleAssignmentScheduleRequestPropertiesTicketInfo ticketInfo) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleRequestProperties(); + } + this.innerProperties().withTicketInfo(ticketInfo); + return this; + } + + /** + * Get the condition property: The conditions on the role assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @return the condition value. + */ + public String condition() { + return this.innerProperties() == null ? null : this.innerProperties().condition(); + } + + /** + * Set the condition property: The conditions on the role assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @param condition the condition value to set. + * @return the RoleAssignmentScheduleRequestInner object itself. + */ + public RoleAssignmentScheduleRequestInner withCondition(String condition) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleRequestProperties(); + } + this.innerProperties().withCondition(condition); + return this; + } + + /** + * Get the conditionVersion property: Version of the condition. Currently accepted value is '2.0'. + * + * @return the conditionVersion value. + */ + public String conditionVersion() { + return this.innerProperties() == null ? null : this.innerProperties().conditionVersion(); + } + + /** + * Set the conditionVersion property: Version of the condition. Currently accepted value is '2.0'. + * + * @param conditionVersion the conditionVersion value to set. + * @return the RoleAssignmentScheduleRequestInner object itself. + */ + public RoleAssignmentScheduleRequestInner withConditionVersion(String conditionVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentScheduleRequestProperties(); + } + this.innerProperties().withConditionVersion(conditionVersion); + return this; + } + + /** + * Get the createdOn property: DateTime when role assignment schedule request was created. + * + * @return the createdOn value. + */ + public OffsetDateTime createdOn() { + return this.innerProperties() == null ? null : this.innerProperties().createdOn(); + } + + /** + * Get the requestorId property: Id of the user who created this request. + * + * @return the requestorId value. + */ + public String requestorId() { + return this.innerProperties() == null ? null : this.innerProperties().requestorId(); + } + + /** + * Get the expandedProperties property: Additional properties of principal, scope and role definition. + * + * @return the expandedProperties value. + */ + public ExpandedProperties expandedProperties() { + return this.innerProperties() == null ? null : this.innerProperties().expandedProperties(); + } + + /** + * 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/RoleAssignmentScheduleRequestProperties.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleAssignmentScheduleRequestProperties.java new file mode 100644 index 000000000000..5f2102d7d2a8 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleAssignmentScheduleRequestProperties.java @@ -0,0 +1,469 @@ +// 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.ExpandedProperties; +import com.azure.resourcemanager.authorization.generated.models.PrincipalType; +import com.azure.resourcemanager.authorization.generated.models.RequestType; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignmentScheduleRequestPropertiesScheduleInfo; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignmentScheduleRequestPropertiesTicketInfo; +import com.azure.resourcemanager.authorization.generated.models.Status; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Role assignment schedule request properties with scope. */ +@Fluent +public final class RoleAssignmentScheduleRequestProperties { + /* + * The role assignment schedule request scope. + */ + @JsonProperty(value = "scope", access = JsonProperty.Access.WRITE_ONLY) + private String scope; + + /* + * The role definition ID. + */ + @JsonProperty(value = "roleDefinitionId", required = true) + private String roleDefinitionId; + + /* + * The principal ID. + */ + @JsonProperty(value = "principalId", required = true) + private String principalId; + + /* + * The principal type of the assigned principal ID. + */ + @JsonProperty(value = "principalType", access = JsonProperty.Access.WRITE_ONLY) + private PrincipalType principalType; + + /* + * The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc + */ + @JsonProperty(value = "requestType", required = true) + private RequestType requestType; + + /* + * The status of the role assignment schedule request. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private Status status; + + /* + * The approvalId of the role assignment schedule request. + */ + @JsonProperty(value = "approvalId", access = JsonProperty.Access.WRITE_ONLY) + private String approvalId; + + /* + * The resultant role assignment schedule id or the role assignment schedule id being updated + */ + @JsonProperty(value = "targetRoleAssignmentScheduleId") + private String targetRoleAssignmentScheduleId; + + /* + * The role assignment schedule instance id being updated + */ + @JsonProperty(value = "targetRoleAssignmentScheduleInstanceId") + private String targetRoleAssignmentScheduleInstanceId; + + /* + * Schedule info of the role assignment schedule + */ + @JsonProperty(value = "scheduleInfo") + private RoleAssignmentScheduleRequestPropertiesScheduleInfo scheduleInfo; + + /* + * The linked role eligibility schedule id - to activate an eligibility. + */ + @JsonProperty(value = "linkedRoleEligibilityScheduleId") + private String linkedRoleEligibilityScheduleId; + + /* + * Justification for the role assignment + */ + @JsonProperty(value = "justification") + private String justification; + + /* + * Ticket Info of the role assignment + */ + @JsonProperty(value = "ticketInfo") + private RoleAssignmentScheduleRequestPropertiesTicketInfo ticketInfo; + + /* + * The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: + * @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase + * 'foo_storage_container' + */ + @JsonProperty(value = "condition") + private String condition; + + /* + * Version of the condition. Currently accepted value is '2.0' + */ + @JsonProperty(value = "conditionVersion") + private String conditionVersion; + + /* + * DateTime when role assignment schedule request was created + */ + @JsonProperty(value = "createdOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdOn; + + /* + * Id of the user who created this request + */ + @JsonProperty(value = "requestorId", access = JsonProperty.Access.WRITE_ONLY) + private String requestorId; + + /* + * Additional properties of principal, scope and role definition + */ + @JsonProperty(value = "expandedProperties", access = JsonProperty.Access.WRITE_ONLY) + private ExpandedProperties expandedProperties; + + /** Creates an instance of RoleAssignmentScheduleRequestProperties class. */ + public RoleAssignmentScheduleRequestProperties() { + } + + /** + * Get the scope property: The role assignment schedule request scope. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Get the roleDefinitionId property: The role definition ID. + * + * @return the roleDefinitionId value. + */ + public String roleDefinitionId() { + return this.roleDefinitionId; + } + + /** + * Set the roleDefinitionId property: The role definition ID. + * + * @param roleDefinitionId the roleDefinitionId value to set. + * @return the RoleAssignmentScheduleRequestProperties object itself. + */ + public RoleAssignmentScheduleRequestProperties withRoleDefinitionId(String roleDefinitionId) { + this.roleDefinitionId = roleDefinitionId; + return this; + } + + /** + * Get the principalId property: The principal ID. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: The principal ID. + * + * @param principalId the principalId value to set. + * @return the RoleAssignmentScheduleRequestProperties object itself. + */ + public RoleAssignmentScheduleRequestProperties withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the principalType property: The principal type of the assigned principal ID. + * + * @return the principalType value. + */ + public PrincipalType principalType() { + return this.principalType; + } + + /** + * Get the requestType property: The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign + * etc. + * + * @return the requestType value. + */ + public RequestType requestType() { + return this.requestType; + } + + /** + * Set the requestType property: The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign + * etc. + * + * @param requestType the requestType value to set. + * @return the RoleAssignmentScheduleRequestProperties object itself. + */ + public RoleAssignmentScheduleRequestProperties withRequestType(RequestType requestType) { + this.requestType = requestType; + return this; + } + + /** + * Get the status property: The status of the role assignment schedule request. + * + * @return the status value. + */ + public Status status() { + return this.status; + } + + /** + * Get the approvalId property: The approvalId of the role assignment schedule request. + * + * @return the approvalId value. + */ + public String approvalId() { + return this.approvalId; + } + + /** + * Get the targetRoleAssignmentScheduleId property: The resultant role assignment schedule id or the role assignment + * schedule id being updated. + * + * @return the targetRoleAssignmentScheduleId value. + */ + public String targetRoleAssignmentScheduleId() { + return this.targetRoleAssignmentScheduleId; + } + + /** + * Set the targetRoleAssignmentScheduleId property: The resultant role assignment schedule id or the role assignment + * schedule id being updated. + * + * @param targetRoleAssignmentScheduleId the targetRoleAssignmentScheduleId value to set. + * @return the RoleAssignmentScheduleRequestProperties object itself. + */ + public RoleAssignmentScheduleRequestProperties withTargetRoleAssignmentScheduleId( + String targetRoleAssignmentScheduleId) { + this.targetRoleAssignmentScheduleId = targetRoleAssignmentScheduleId; + return this; + } + + /** + * Get the targetRoleAssignmentScheduleInstanceId property: The role assignment schedule instance id being updated. + * + * @return the targetRoleAssignmentScheduleInstanceId value. + */ + public String targetRoleAssignmentScheduleInstanceId() { + return this.targetRoleAssignmentScheduleInstanceId; + } + + /** + * Set the targetRoleAssignmentScheduleInstanceId property: The role assignment schedule instance id being updated. + * + * @param targetRoleAssignmentScheduleInstanceId the targetRoleAssignmentScheduleInstanceId value to set. + * @return the RoleAssignmentScheduleRequestProperties object itself. + */ + public RoleAssignmentScheduleRequestProperties withTargetRoleAssignmentScheduleInstanceId( + String targetRoleAssignmentScheduleInstanceId) { + this.targetRoleAssignmentScheduleInstanceId = targetRoleAssignmentScheduleInstanceId; + return this; + } + + /** + * Get the scheduleInfo property: Schedule info of the role assignment schedule. + * + * @return the scheduleInfo value. + */ + public RoleAssignmentScheduleRequestPropertiesScheduleInfo scheduleInfo() { + return this.scheduleInfo; + } + + /** + * Set the scheduleInfo property: Schedule info of the role assignment schedule. + * + * @param scheduleInfo the scheduleInfo value to set. + * @return the RoleAssignmentScheduleRequestProperties object itself. + */ + public RoleAssignmentScheduleRequestProperties withScheduleInfo( + RoleAssignmentScheduleRequestPropertiesScheduleInfo scheduleInfo) { + this.scheduleInfo = scheduleInfo; + return this; + } + + /** + * Get the linkedRoleEligibilityScheduleId property: The linked role eligibility schedule id - to activate an + * eligibility. + * + * @return the linkedRoleEligibilityScheduleId value. + */ + public String linkedRoleEligibilityScheduleId() { + return this.linkedRoleEligibilityScheduleId; + } + + /** + * Set the linkedRoleEligibilityScheduleId property: The linked role eligibility schedule id - to activate an + * eligibility. + * + * @param linkedRoleEligibilityScheduleId the linkedRoleEligibilityScheduleId value to set. + * @return the RoleAssignmentScheduleRequestProperties object itself. + */ + public RoleAssignmentScheduleRequestProperties withLinkedRoleEligibilityScheduleId( + String linkedRoleEligibilityScheduleId) { + this.linkedRoleEligibilityScheduleId = linkedRoleEligibilityScheduleId; + return this; + } + + /** + * Get the justification property: Justification for the role assignment. + * + * @return the justification value. + */ + public String justification() { + return this.justification; + } + + /** + * Set the justification property: Justification for the role assignment. + * + * @param justification the justification value to set. + * @return the RoleAssignmentScheduleRequestProperties object itself. + */ + public RoleAssignmentScheduleRequestProperties withJustification(String justification) { + this.justification = justification; + return this; + } + + /** + * Get the ticketInfo property: Ticket Info of the role assignment. + * + * @return the ticketInfo value. + */ + public RoleAssignmentScheduleRequestPropertiesTicketInfo ticketInfo() { + return this.ticketInfo; + } + + /** + * Set the ticketInfo property: Ticket Info of the role assignment. + * + * @param ticketInfo the ticketInfo value to set. + * @return the RoleAssignmentScheduleRequestProperties object itself. + */ + public RoleAssignmentScheduleRequestProperties withTicketInfo( + RoleAssignmentScheduleRequestPropertiesTicketInfo ticketInfo) { + this.ticketInfo = ticketInfo; + return this; + } + + /** + * Get the condition property: The conditions on the role assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @return the condition value. + */ + public String condition() { + return this.condition; + } + + /** + * Set the condition property: The conditions on the role assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @param condition the condition value to set. + * @return the RoleAssignmentScheduleRequestProperties object itself. + */ + public RoleAssignmentScheduleRequestProperties withCondition(String condition) { + this.condition = condition; + return this; + } + + /** + * Get the conditionVersion property: Version of the condition. Currently accepted value is '2.0'. + * + * @return the conditionVersion value. + */ + public String conditionVersion() { + return this.conditionVersion; + } + + /** + * Set the conditionVersion property: Version of the condition. Currently accepted value is '2.0'. + * + * @param conditionVersion the conditionVersion value to set. + * @return the RoleAssignmentScheduleRequestProperties object itself. + */ + public RoleAssignmentScheduleRequestProperties withConditionVersion(String conditionVersion) { + this.conditionVersion = conditionVersion; + return this; + } + + /** + * Get the createdOn property: DateTime when role assignment schedule request was created. + * + * @return the createdOn value. + */ + public OffsetDateTime createdOn() { + return this.createdOn; + } + + /** + * Get the requestorId property: Id of the user who created this request. + * + * @return the requestorId value. + */ + public String requestorId() { + return this.requestorId; + } + + /** + * Get the expandedProperties property: Additional properties of principal, scope and role definition. + * + * @return the expandedProperties value. + */ + public ExpandedProperties expandedProperties() { + return this.expandedProperties; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (roleDefinitionId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property roleDefinitionId in model RoleAssignmentScheduleRequestProperties")); + } + if (principalId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property principalId in model RoleAssignmentScheduleRequestProperties")); + } + if (requestType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property requestType in model RoleAssignmentScheduleRequestProperties")); + } + if (scheduleInfo() != null) { + scheduleInfo().validate(); + } + if (ticketInfo() != null) { + ticketInfo().validate(); + } + if (expandedProperties() != null) { + expandedProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RoleAssignmentScheduleRequestProperties.class); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleDefinitionInner.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleDefinitionInner.java new file mode 100644 index 000000000000..a54cbeff2ac7 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleDefinitionInner.java @@ -0,0 +1,196 @@ +// 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; +import java.util.List; + +/** Role definition. */ +@Fluent +public final class RoleDefinitionInner extends ProxyResource { + /* + * Role definition properties. + */ + @JsonProperty(value = "properties") + private RoleDefinitionProperties innerProperties; + + /** Creates an instance of RoleDefinitionInner class. */ + public RoleDefinitionInner() { + } + + /** + * Get the innerProperties property: Role definition properties. + * + * @return the innerProperties value. + */ + private RoleDefinitionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the roleName property: The role name. + * + * @return the roleName value. + */ + public String roleName() { + return this.innerProperties() == null ? null : this.innerProperties().roleName(); + } + + /** + * Set the roleName property: The role name. + * + * @param roleName the roleName value to set. + * @return the RoleDefinitionInner object itself. + */ + public RoleDefinitionInner withRoleName(String roleName) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleDefinitionProperties(); + } + this.innerProperties().withRoleName(roleName); + return this; + } + + /** + * Get the description property: The role definition description. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: The role definition description. + * + * @param description the description value to set. + * @return the RoleDefinitionInner object itself. + */ + public RoleDefinitionInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleDefinitionProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the roleType property: The role type. + * + * @return the roleType value. + */ + public String roleType() { + return this.innerProperties() == null ? null : this.innerProperties().roleType(); + } + + /** + * Set the roleType property: The role type. + * + * @param roleType the roleType value to set. + * @return the RoleDefinitionInner object itself. + */ + public RoleDefinitionInner withRoleType(String roleType) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleDefinitionProperties(); + } + this.innerProperties().withRoleType(roleType); + return this; + } + + /** + * Get the permissions property: Role definition permissions. + * + * @return the permissions value. + */ + public List permissions() { + return this.innerProperties() == null ? null : this.innerProperties().permissions(); + } + + /** + * Set the permissions property: Role definition permissions. + * + * @param permissions the permissions value to set. + * @return the RoleDefinitionInner object itself. + */ + public RoleDefinitionInner withPermissions(List permissions) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleDefinitionProperties(); + } + this.innerProperties().withPermissions(permissions); + return this; + } + + /** + * Get the assignableScopes property: Role definition assignable scopes. + * + * @return the assignableScopes value. + */ + public List assignableScopes() { + return this.innerProperties() == null ? null : this.innerProperties().assignableScopes(); + } + + /** + * Set the assignableScopes property: Role definition assignable scopes. + * + * @param assignableScopes the assignableScopes value to set. + * @return the RoleDefinitionInner object itself. + */ + public RoleDefinitionInner withAssignableScopes(List assignableScopes) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleDefinitionProperties(); + } + this.innerProperties().withAssignableScopes(assignableScopes); + return this; + } + + /** + * Get the createdOn property: Time it was created. + * + * @return the createdOn value. + */ + public OffsetDateTime createdOn() { + return this.innerProperties() == null ? null : this.innerProperties().createdOn(); + } + + /** + * Get the updatedOn property: Time it was updated. + * + * @return the updatedOn value. + */ + public OffsetDateTime updatedOn() { + return this.innerProperties() == null ? null : this.innerProperties().updatedOn(); + } + + /** + * Get the createdBy property: Id of the user who created the assignment. + * + * @return the createdBy value. + */ + public String createdBy() { + return this.innerProperties() == null ? null : this.innerProperties().createdBy(); + } + + /** + * Get the updatedBy property: Id of the user who updated the assignment. + * + * @return the updatedBy value. + */ + public String updatedBy() { + return this.innerProperties() == null ? null : this.innerProperties().updatedBy(); + } + + /** + * 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/RoleDefinitionProperties.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleDefinitionProperties.java new file mode 100644 index 000000000000..54f01ab6c914 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleDefinitionProperties.java @@ -0,0 +1,219 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Role definition properties. */ +@Fluent +public final class RoleDefinitionProperties { + /* + * The role name. + */ + @JsonProperty(value = "roleName") + private String roleName; + + /* + * The role definition description. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The role type. + */ + @JsonProperty(value = "type") + private String roleType; + + /* + * Role definition permissions. + */ + @JsonProperty(value = "permissions") + private List permissions; + + /* + * Role definition assignable scopes. + */ + @JsonProperty(value = "assignableScopes") + private List assignableScopes; + + /* + * Time it was created + */ + @JsonProperty(value = "createdOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdOn; + + /* + * Time it was updated + */ + @JsonProperty(value = "updatedOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime updatedOn; + + /* + * Id of the user who created the assignment + */ + @JsonProperty(value = "createdBy", access = JsonProperty.Access.WRITE_ONLY) + private String createdBy; + + /* + * Id of the user who updated the assignment + */ + @JsonProperty(value = "updatedBy", access = JsonProperty.Access.WRITE_ONLY) + private String updatedBy; + + /** Creates an instance of RoleDefinitionProperties class. */ + public RoleDefinitionProperties() { + } + + /** + * Get the roleName property: The role name. + * + * @return the roleName value. + */ + public String roleName() { + return this.roleName; + } + + /** + * Set the roleName property: The role name. + * + * @param roleName the roleName value to set. + * @return the RoleDefinitionProperties object itself. + */ + public RoleDefinitionProperties withRoleName(String roleName) { + this.roleName = roleName; + return this; + } + + /** + * Get the description property: The role definition description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The role definition description. + * + * @param description the description value to set. + * @return the RoleDefinitionProperties object itself. + */ + public RoleDefinitionProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the roleType property: The role type. + * + * @return the roleType value. + */ + public String roleType() { + return this.roleType; + } + + /** + * Set the roleType property: The role type. + * + * @param roleType the roleType value to set. + * @return the RoleDefinitionProperties object itself. + */ + public RoleDefinitionProperties withRoleType(String roleType) { + this.roleType = roleType; + return this; + } + + /** + * Get the permissions property: Role definition permissions. + * + * @return the permissions value. + */ + public List permissions() { + return this.permissions; + } + + /** + * Set the permissions property: Role definition permissions. + * + * @param permissions the permissions value to set. + * @return the RoleDefinitionProperties object itself. + */ + public RoleDefinitionProperties withPermissions(List permissions) { + this.permissions = permissions; + return this; + } + + /** + * Get the assignableScopes property: Role definition assignable scopes. + * + * @return the assignableScopes value. + */ + public List assignableScopes() { + return this.assignableScopes; + } + + /** + * Set the assignableScopes property: Role definition assignable scopes. + * + * @param assignableScopes the assignableScopes value to set. + * @return the RoleDefinitionProperties object itself. + */ + public RoleDefinitionProperties withAssignableScopes(List assignableScopes) { + this.assignableScopes = assignableScopes; + return this; + } + + /** + * Get the createdOn property: Time it was created. + * + * @return the createdOn value. + */ + public OffsetDateTime createdOn() { + return this.createdOn; + } + + /** + * Get the updatedOn property: Time it was updated. + * + * @return the updatedOn value. + */ + public OffsetDateTime updatedOn() { + return this.updatedOn; + } + + /** + * Get the createdBy property: Id of the user who created the assignment. + * + * @return the createdBy value. + */ + public String createdBy() { + return this.createdBy; + } + + /** + * Get the updatedBy property: Id of the user who updated the assignment. + * + * @return the updatedBy value. + */ + public String updatedBy() { + return this.updatedBy; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (permissions() != null) { + permissions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleEligibilityScheduleInner.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleEligibilityScheduleInner.java new file mode 100644 index 000000000000..19370545b652 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleEligibilityScheduleInner.java @@ -0,0 +1,420 @@ +// 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.ExpandedProperties; +import com.azure.resourcemanager.authorization.generated.models.MemberType; +import com.azure.resourcemanager.authorization.generated.models.PrincipalType; +import com.azure.resourcemanager.authorization.generated.models.Status; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Role eligibility schedule. */ +@Fluent +public final class RoleEligibilityScheduleInner { + /* + * The role eligibility schedule Id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The role eligibility schedule name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The role eligibility schedule type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * role eligibility schedule properties. + */ + @JsonProperty(value = "properties") + private RoleEligibilityScheduleProperties innerProperties; + + /** Creates an instance of RoleEligibilityScheduleInner class. */ + public RoleEligibilityScheduleInner() { + } + + /** + * Get the id property: The role eligibility schedule Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The role eligibility schedule name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: The role eligibility schedule type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the innerProperties property: role eligibility schedule properties. + * + * @return the innerProperties value. + */ + private RoleEligibilityScheduleProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the scope property: The role eligibility schedule scope. + * + * @return the scope value. + */ + public String scope() { + return this.innerProperties() == null ? null : this.innerProperties().scope(); + } + + /** + * Set the scope property: The role eligibility schedule scope. + * + * @param scope the scope value to set. + * @return the RoleEligibilityScheduleInner object itself. + */ + public RoleEligibilityScheduleInner withScope(String scope) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleEligibilityScheduleProperties(); + } + this.innerProperties().withScope(scope); + return this; + } + + /** + * Get the roleDefinitionId property: The role definition ID. + * + * @return the roleDefinitionId value. + */ + public String roleDefinitionId() { + return this.innerProperties() == null ? null : this.innerProperties().roleDefinitionId(); + } + + /** + * Set the roleDefinitionId property: The role definition ID. + * + * @param roleDefinitionId the roleDefinitionId value to set. + * @return the RoleEligibilityScheduleInner object itself. + */ + public RoleEligibilityScheduleInner withRoleDefinitionId(String roleDefinitionId) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleEligibilityScheduleProperties(); + } + this.innerProperties().withRoleDefinitionId(roleDefinitionId); + return this; + } + + /** + * Get the principalId property: The principal ID. + * + * @return the principalId value. + */ + public String principalId() { + return this.innerProperties() == null ? null : this.innerProperties().principalId(); + } + + /** + * Set the principalId property: The principal ID. + * + * @param principalId the principalId value to set. + * @return the RoleEligibilityScheduleInner object itself. + */ + public RoleEligibilityScheduleInner withPrincipalId(String principalId) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleEligibilityScheduleProperties(); + } + this.innerProperties().withPrincipalId(principalId); + return this; + } + + /** + * Get the principalType property: The principal type of the assigned principal ID. + * + * @return the principalType value. + */ + public PrincipalType principalType() { + return this.innerProperties() == null ? null : this.innerProperties().principalType(); + } + + /** + * Set the principalType property: The principal type of the assigned principal ID. + * + * @param principalType the principalType value to set. + * @return the RoleEligibilityScheduleInner object itself. + */ + public RoleEligibilityScheduleInner withPrincipalType(PrincipalType principalType) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleEligibilityScheduleProperties(); + } + this.innerProperties().withPrincipalType(principalType); + return this; + } + + /** + * Get the roleEligibilityScheduleRequestId property: The id of roleEligibilityScheduleRequest used to create this + * roleAssignmentSchedule. + * + * @return the roleEligibilityScheduleRequestId value. + */ + public String roleEligibilityScheduleRequestId() { + return this.innerProperties() == null ? null : this.innerProperties().roleEligibilityScheduleRequestId(); + } + + /** + * Set the roleEligibilityScheduleRequestId property: The id of roleEligibilityScheduleRequest used to create this + * roleAssignmentSchedule. + * + * @param roleEligibilityScheduleRequestId the roleEligibilityScheduleRequestId value to set. + * @return the RoleEligibilityScheduleInner object itself. + */ + public RoleEligibilityScheduleInner withRoleEligibilityScheduleRequestId(String roleEligibilityScheduleRequestId) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleEligibilityScheduleProperties(); + } + this.innerProperties().withRoleEligibilityScheduleRequestId(roleEligibilityScheduleRequestId); + return this; + } + + /** + * Get the memberType property: Membership type of the role eligibility schedule. + * + * @return the memberType value. + */ + public MemberType memberType() { + return this.innerProperties() == null ? null : this.innerProperties().memberType(); + } + + /** + * Set the memberType property: Membership type of the role eligibility schedule. + * + * @param memberType the memberType value to set. + * @return the RoleEligibilityScheduleInner object itself. + */ + public RoleEligibilityScheduleInner withMemberType(MemberType memberType) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleEligibilityScheduleProperties(); + } + this.innerProperties().withMemberType(memberType); + return this; + } + + /** + * Get the status property: The status of the role eligibility schedule. + * + * @return the status value. + */ + public Status status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: The status of the role eligibility schedule. + * + * @param status the status value to set. + * @return the RoleEligibilityScheduleInner object itself. + */ + public RoleEligibilityScheduleInner withStatus(Status status) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleEligibilityScheduleProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Get the startDateTime property: Start DateTime when role eligibility schedule. + * + * @return the startDateTime value. + */ + public OffsetDateTime startDateTime() { + return this.innerProperties() == null ? null : this.innerProperties().startDateTime(); + } + + /** + * Set the startDateTime property: Start DateTime when role eligibility schedule. + * + * @param startDateTime the startDateTime value to set. + * @return the RoleEligibilityScheduleInner object itself. + */ + public RoleEligibilityScheduleInner withStartDateTime(OffsetDateTime startDateTime) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleEligibilityScheduleProperties(); + } + this.innerProperties().withStartDateTime(startDateTime); + return this; + } + + /** + * Get the endDateTime property: End DateTime when role eligibility schedule. + * + * @return the endDateTime value. + */ + public OffsetDateTime endDateTime() { + return this.innerProperties() == null ? null : this.innerProperties().endDateTime(); + } + + /** + * Set the endDateTime property: End DateTime when role eligibility schedule. + * + * @param endDateTime the endDateTime value to set. + * @return the RoleEligibilityScheduleInner object itself. + */ + public RoleEligibilityScheduleInner withEndDateTime(OffsetDateTime endDateTime) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleEligibilityScheduleProperties(); + } + this.innerProperties().withEndDateTime(endDateTime); + return this; + } + + /** + * Get the condition property: The conditions on the role assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @return the condition value. + */ + public String condition() { + return this.innerProperties() == null ? null : this.innerProperties().condition(); + } + + /** + * Set the condition property: The conditions on the role assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @param condition the condition value to set. + * @return the RoleEligibilityScheduleInner object itself. + */ + public RoleEligibilityScheduleInner withCondition(String condition) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleEligibilityScheduleProperties(); + } + this.innerProperties().withCondition(condition); + return this; + } + + /** + * Get the conditionVersion property: Version of the condition. Currently accepted value is '2.0'. + * + * @return the conditionVersion value. + */ + public String conditionVersion() { + return this.innerProperties() == null ? null : this.innerProperties().conditionVersion(); + } + + /** + * Set the conditionVersion property: Version of the condition. Currently accepted value is '2.0'. + * + * @param conditionVersion the conditionVersion value to set. + * @return the RoleEligibilityScheduleInner object itself. + */ + public RoleEligibilityScheduleInner withConditionVersion(String conditionVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleEligibilityScheduleProperties(); + } + this.innerProperties().withConditionVersion(conditionVersion); + return this; + } + + /** + * Get the createdOn property: DateTime when role eligibility schedule was created. + * + * @return the createdOn value. + */ + public OffsetDateTime createdOn() { + return this.innerProperties() == null ? null : this.innerProperties().createdOn(); + } + + /** + * Set the createdOn property: DateTime when role eligibility schedule was created. + * + * @param createdOn the createdOn value to set. + * @return the RoleEligibilityScheduleInner object itself. + */ + public RoleEligibilityScheduleInner withCreatedOn(OffsetDateTime createdOn) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleEligibilityScheduleProperties(); + } + this.innerProperties().withCreatedOn(createdOn); + return this; + } + + /** + * Get the updatedOn property: DateTime when role eligibility schedule was modified. + * + * @return the updatedOn value. + */ + public OffsetDateTime updatedOn() { + return this.innerProperties() == null ? null : this.innerProperties().updatedOn(); + } + + /** + * Set the updatedOn property: DateTime when role eligibility schedule was modified. + * + * @param updatedOn the updatedOn value to set. + * @return the RoleEligibilityScheduleInner object itself. + */ + public RoleEligibilityScheduleInner withUpdatedOn(OffsetDateTime updatedOn) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleEligibilityScheduleProperties(); + } + this.innerProperties().withUpdatedOn(updatedOn); + return this; + } + + /** + * Get the expandedProperties property: Additional properties of principal, scope and role definition. + * + * @return the expandedProperties value. + */ + public ExpandedProperties expandedProperties() { + return this.innerProperties() == null ? null : this.innerProperties().expandedProperties(); + } + + /** + * Set the expandedProperties property: Additional properties of principal, scope and role definition. + * + * @param expandedProperties the expandedProperties value to set. + * @return the RoleEligibilityScheduleInner object itself. + */ + public RoleEligibilityScheduleInner withExpandedProperties(ExpandedProperties expandedProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleEligibilityScheduleProperties(); + } + this.innerProperties().withExpandedProperties(expandedProperties); + 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/RoleEligibilityScheduleInstanceInner.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleEligibilityScheduleInstanceInner.java new file mode 100644 index 000000000000..95d9f7af10fc --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleEligibilityScheduleInstanceInner.java @@ -0,0 +1,395 @@ +// 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.ExpandedProperties; +import com.azure.resourcemanager.authorization.generated.models.MemberType; +import com.azure.resourcemanager.authorization.generated.models.PrincipalType; +import com.azure.resourcemanager.authorization.generated.models.Status; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Information about current or upcoming role eligibility schedule instance. */ +@Fluent +public final class RoleEligibilityScheduleInstanceInner { + /* + * The role eligibility schedule instance ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The role eligibility schedule instance name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The role eligibility schedule instance type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Role eligibility schedule instance properties. + */ + @JsonProperty(value = "properties") + private RoleEligibilityScheduleInstanceProperties innerProperties; + + /** Creates an instance of RoleEligibilityScheduleInstanceInner class. */ + public RoleEligibilityScheduleInstanceInner() { + } + + /** + * Get the id property: The role eligibility schedule instance ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The role eligibility schedule instance name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: The role eligibility schedule instance type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the innerProperties property: Role eligibility schedule instance properties. + * + * @return the innerProperties value. + */ + private RoleEligibilityScheduleInstanceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the scope property: The role eligibility schedule scope. + * + * @return the scope value. + */ + public String scope() { + return this.innerProperties() == null ? null : this.innerProperties().scope(); + } + + /** + * Set the scope property: The role eligibility schedule scope. + * + * @param scope the scope value to set. + * @return the RoleEligibilityScheduleInstanceInner object itself. + */ + public RoleEligibilityScheduleInstanceInner withScope(String scope) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleEligibilityScheduleInstanceProperties(); + } + this.innerProperties().withScope(scope); + return this; + } + + /** + * Get the roleDefinitionId property: The role definition ID. + * + * @return the roleDefinitionId value. + */ + public String roleDefinitionId() { + return this.innerProperties() == null ? null : this.innerProperties().roleDefinitionId(); + } + + /** + * Set the roleDefinitionId property: The role definition ID. + * + * @param roleDefinitionId the roleDefinitionId value to set. + * @return the RoleEligibilityScheduleInstanceInner object itself. + */ + public RoleEligibilityScheduleInstanceInner withRoleDefinitionId(String roleDefinitionId) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleEligibilityScheduleInstanceProperties(); + } + this.innerProperties().withRoleDefinitionId(roleDefinitionId); + return this; + } + + /** + * Get the principalId property: The principal ID. + * + * @return the principalId value. + */ + public String principalId() { + return this.innerProperties() == null ? null : this.innerProperties().principalId(); + } + + /** + * Set the principalId property: The principal ID. + * + * @param principalId the principalId value to set. + * @return the RoleEligibilityScheduleInstanceInner object itself. + */ + public RoleEligibilityScheduleInstanceInner withPrincipalId(String principalId) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleEligibilityScheduleInstanceProperties(); + } + this.innerProperties().withPrincipalId(principalId); + return this; + } + + /** + * Get the principalType property: The principal type of the assigned principal ID. + * + * @return the principalType value. + */ + public PrincipalType principalType() { + return this.innerProperties() == null ? null : this.innerProperties().principalType(); + } + + /** + * Set the principalType property: The principal type of the assigned principal ID. + * + * @param principalType the principalType value to set. + * @return the RoleEligibilityScheduleInstanceInner object itself. + */ + public RoleEligibilityScheduleInstanceInner withPrincipalType(PrincipalType principalType) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleEligibilityScheduleInstanceProperties(); + } + this.innerProperties().withPrincipalType(principalType); + return this; + } + + /** + * Get the roleEligibilityScheduleId property: Id of the master role eligibility schedule. + * + * @return the roleEligibilityScheduleId value. + */ + public String roleEligibilityScheduleId() { + return this.innerProperties() == null ? null : this.innerProperties().roleEligibilityScheduleId(); + } + + /** + * Set the roleEligibilityScheduleId property: Id of the master role eligibility schedule. + * + * @param roleEligibilityScheduleId the roleEligibilityScheduleId value to set. + * @return the RoleEligibilityScheduleInstanceInner object itself. + */ + public RoleEligibilityScheduleInstanceInner withRoleEligibilityScheduleId(String roleEligibilityScheduleId) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleEligibilityScheduleInstanceProperties(); + } + this.innerProperties().withRoleEligibilityScheduleId(roleEligibilityScheduleId); + return this; + } + + /** + * Get the status property: The status of the role eligibility schedule instance. + * + * @return the status value. + */ + public Status status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: The status of the role eligibility schedule instance. + * + * @param status the status value to set. + * @return the RoleEligibilityScheduleInstanceInner object itself. + */ + public RoleEligibilityScheduleInstanceInner withStatus(Status status) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleEligibilityScheduleInstanceProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Get the startDateTime property: The startDateTime of the role eligibility schedule instance. + * + * @return the startDateTime value. + */ + public OffsetDateTime startDateTime() { + return this.innerProperties() == null ? null : this.innerProperties().startDateTime(); + } + + /** + * Set the startDateTime property: The startDateTime of the role eligibility schedule instance. + * + * @param startDateTime the startDateTime value to set. + * @return the RoleEligibilityScheduleInstanceInner object itself. + */ + public RoleEligibilityScheduleInstanceInner withStartDateTime(OffsetDateTime startDateTime) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleEligibilityScheduleInstanceProperties(); + } + this.innerProperties().withStartDateTime(startDateTime); + return this; + } + + /** + * Get the endDateTime property: The endDateTime of the role eligibility schedule instance. + * + * @return the endDateTime value. + */ + public OffsetDateTime endDateTime() { + return this.innerProperties() == null ? null : this.innerProperties().endDateTime(); + } + + /** + * Set the endDateTime property: The endDateTime of the role eligibility schedule instance. + * + * @param endDateTime the endDateTime value to set. + * @return the RoleEligibilityScheduleInstanceInner object itself. + */ + public RoleEligibilityScheduleInstanceInner withEndDateTime(OffsetDateTime endDateTime) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleEligibilityScheduleInstanceProperties(); + } + this.innerProperties().withEndDateTime(endDateTime); + return this; + } + + /** + * Get the memberType property: Membership type of the role eligibility schedule. + * + * @return the memberType value. + */ + public MemberType memberType() { + return this.innerProperties() == null ? null : this.innerProperties().memberType(); + } + + /** + * Set the memberType property: Membership type of the role eligibility schedule. + * + * @param memberType the memberType value to set. + * @return the RoleEligibilityScheduleInstanceInner object itself. + */ + public RoleEligibilityScheduleInstanceInner withMemberType(MemberType memberType) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleEligibilityScheduleInstanceProperties(); + } + this.innerProperties().withMemberType(memberType); + return this; + } + + /** + * Get the condition property: The conditions on the role assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @return the condition value. + */ + public String condition() { + return this.innerProperties() == null ? null : this.innerProperties().condition(); + } + + /** + * Set the condition property: The conditions on the role assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @param condition the condition value to set. + * @return the RoleEligibilityScheduleInstanceInner object itself. + */ + public RoleEligibilityScheduleInstanceInner withCondition(String condition) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleEligibilityScheduleInstanceProperties(); + } + this.innerProperties().withCondition(condition); + return this; + } + + /** + * Get the conditionVersion property: Version of the condition. Currently accepted value is '2.0'. + * + * @return the conditionVersion value. + */ + public String conditionVersion() { + return this.innerProperties() == null ? null : this.innerProperties().conditionVersion(); + } + + /** + * Set the conditionVersion property: Version of the condition. Currently accepted value is '2.0'. + * + * @param conditionVersion the conditionVersion value to set. + * @return the RoleEligibilityScheduleInstanceInner object itself. + */ + public RoleEligibilityScheduleInstanceInner withConditionVersion(String conditionVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleEligibilityScheduleInstanceProperties(); + } + this.innerProperties().withConditionVersion(conditionVersion); + return this; + } + + /** + * Get the createdOn property: DateTime when role eligibility schedule was created. + * + * @return the createdOn value. + */ + public OffsetDateTime createdOn() { + return this.innerProperties() == null ? null : this.innerProperties().createdOn(); + } + + /** + * Set the createdOn property: DateTime when role eligibility schedule was created. + * + * @param createdOn the createdOn value to set. + * @return the RoleEligibilityScheduleInstanceInner object itself. + */ + public RoleEligibilityScheduleInstanceInner withCreatedOn(OffsetDateTime createdOn) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleEligibilityScheduleInstanceProperties(); + } + this.innerProperties().withCreatedOn(createdOn); + return this; + } + + /** + * Get the expandedProperties property: Additional properties of principal, scope and role definition. + * + * @return the expandedProperties value. + */ + public ExpandedProperties expandedProperties() { + return this.innerProperties() == null ? null : this.innerProperties().expandedProperties(); + } + + /** + * Set the expandedProperties property: Additional properties of principal, scope and role definition. + * + * @param expandedProperties the expandedProperties value to set. + * @return the RoleEligibilityScheduleInstanceInner object itself. + */ + public RoleEligibilityScheduleInstanceInner withExpandedProperties(ExpandedProperties expandedProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleEligibilityScheduleInstanceProperties(); + } + this.innerProperties().withExpandedProperties(expandedProperties); + 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/RoleEligibilityScheduleInstanceProperties.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleEligibilityScheduleInstanceProperties.java new file mode 100644 index 000000000000..cb8240aacdae --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleEligibilityScheduleInstanceProperties.java @@ -0,0 +1,376 @@ +// 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.ExpandedProperties; +import com.azure.resourcemanager.authorization.generated.models.MemberType; +import com.azure.resourcemanager.authorization.generated.models.PrincipalType; +import com.azure.resourcemanager.authorization.generated.models.Status; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Role eligibility schedule properties with scope. */ +@Fluent +public final class RoleEligibilityScheduleInstanceProperties { + /* + * The role eligibility schedule scope. + */ + @JsonProperty(value = "scope") + private String scope; + + /* + * The role definition ID. + */ + @JsonProperty(value = "roleDefinitionId") + private String roleDefinitionId; + + /* + * The principal ID. + */ + @JsonProperty(value = "principalId") + private String principalId; + + /* + * The principal type of the assigned principal ID. + */ + @JsonProperty(value = "principalType") + private PrincipalType principalType; + + /* + * Id of the master role eligibility schedule + */ + @JsonProperty(value = "roleEligibilityScheduleId") + private String roleEligibilityScheduleId; + + /* + * The status of the role eligibility schedule instance + */ + @JsonProperty(value = "status") + private Status status; + + /* + * The startDateTime of the role eligibility schedule instance + */ + @JsonProperty(value = "startDateTime") + private OffsetDateTime startDateTime; + + /* + * The endDateTime of the role eligibility schedule instance + */ + @JsonProperty(value = "endDateTime") + private OffsetDateTime endDateTime; + + /* + * Membership type of the role eligibility schedule + */ + @JsonProperty(value = "memberType") + private MemberType memberType; + + /* + * The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: + * @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase + * 'foo_storage_container' + */ + @JsonProperty(value = "condition") + private String condition; + + /* + * Version of the condition. Currently accepted value is '2.0' + */ + @JsonProperty(value = "conditionVersion") + private String conditionVersion; + + /* + * DateTime when role eligibility schedule was created + */ + @JsonProperty(value = "createdOn") + private OffsetDateTime createdOn; + + /* + * Additional properties of principal, scope and role definition + */ + @JsonProperty(value = "expandedProperties") + private ExpandedProperties expandedProperties; + + /** Creates an instance of RoleEligibilityScheduleInstanceProperties class. */ + public RoleEligibilityScheduleInstanceProperties() { + } + + /** + * Get the scope property: The role eligibility schedule scope. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope property: The role eligibility schedule scope. + * + * @param scope the scope value to set. + * @return the RoleEligibilityScheduleInstanceProperties object itself. + */ + public RoleEligibilityScheduleInstanceProperties withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the roleDefinitionId property: The role definition ID. + * + * @return the roleDefinitionId value. + */ + public String roleDefinitionId() { + return this.roleDefinitionId; + } + + /** + * Set the roleDefinitionId property: The role definition ID. + * + * @param roleDefinitionId the roleDefinitionId value to set. + * @return the RoleEligibilityScheduleInstanceProperties object itself. + */ + public RoleEligibilityScheduleInstanceProperties withRoleDefinitionId(String roleDefinitionId) { + this.roleDefinitionId = roleDefinitionId; + return this; + } + + /** + * Get the principalId property: The principal ID. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: The principal ID. + * + * @param principalId the principalId value to set. + * @return the RoleEligibilityScheduleInstanceProperties object itself. + */ + public RoleEligibilityScheduleInstanceProperties withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the principalType property: The principal type of the assigned principal ID. + * + * @return the principalType value. + */ + public PrincipalType principalType() { + return this.principalType; + } + + /** + * Set the principalType property: The principal type of the assigned principal ID. + * + * @param principalType the principalType value to set. + * @return the RoleEligibilityScheduleInstanceProperties object itself. + */ + public RoleEligibilityScheduleInstanceProperties withPrincipalType(PrincipalType principalType) { + this.principalType = principalType; + return this; + } + + /** + * Get the roleEligibilityScheduleId property: Id of the master role eligibility schedule. + * + * @return the roleEligibilityScheduleId value. + */ + public String roleEligibilityScheduleId() { + return this.roleEligibilityScheduleId; + } + + /** + * Set the roleEligibilityScheduleId property: Id of the master role eligibility schedule. + * + * @param roleEligibilityScheduleId the roleEligibilityScheduleId value to set. + * @return the RoleEligibilityScheduleInstanceProperties object itself. + */ + public RoleEligibilityScheduleInstanceProperties withRoleEligibilityScheduleId(String roleEligibilityScheduleId) { + this.roleEligibilityScheduleId = roleEligibilityScheduleId; + return this; + } + + /** + * Get the status property: The status of the role eligibility schedule instance. + * + * @return the status value. + */ + public Status status() { + return this.status; + } + + /** + * Set the status property: The status of the role eligibility schedule instance. + * + * @param status the status value to set. + * @return the RoleEligibilityScheduleInstanceProperties object itself. + */ + public RoleEligibilityScheduleInstanceProperties withStatus(Status status) { + this.status = status; + return this; + } + + /** + * Get the startDateTime property: The startDateTime of the role eligibility schedule instance. + * + * @return the startDateTime value. + */ + public OffsetDateTime startDateTime() { + return this.startDateTime; + } + + /** + * Set the startDateTime property: The startDateTime of the role eligibility schedule instance. + * + * @param startDateTime the startDateTime value to set. + * @return the RoleEligibilityScheduleInstanceProperties object itself. + */ + public RoleEligibilityScheduleInstanceProperties withStartDateTime(OffsetDateTime startDateTime) { + this.startDateTime = startDateTime; + return this; + } + + /** + * Get the endDateTime property: The endDateTime of the role eligibility schedule instance. + * + * @return the endDateTime value. + */ + public OffsetDateTime endDateTime() { + return this.endDateTime; + } + + /** + * Set the endDateTime property: The endDateTime of the role eligibility schedule instance. + * + * @param endDateTime the endDateTime value to set. + * @return the RoleEligibilityScheduleInstanceProperties object itself. + */ + public RoleEligibilityScheduleInstanceProperties withEndDateTime(OffsetDateTime endDateTime) { + this.endDateTime = endDateTime; + return this; + } + + /** + * Get the memberType property: Membership type of the role eligibility schedule. + * + * @return the memberType value. + */ + public MemberType memberType() { + return this.memberType; + } + + /** + * Set the memberType property: Membership type of the role eligibility schedule. + * + * @param memberType the memberType value to set. + * @return the RoleEligibilityScheduleInstanceProperties object itself. + */ + public RoleEligibilityScheduleInstanceProperties withMemberType(MemberType memberType) { + this.memberType = memberType; + return this; + } + + /** + * Get the condition property: The conditions on the role assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @return the condition value. + */ + public String condition() { + return this.condition; + } + + /** + * Set the condition property: The conditions on the role assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @param condition the condition value to set. + * @return the RoleEligibilityScheduleInstanceProperties object itself. + */ + public RoleEligibilityScheduleInstanceProperties withCondition(String condition) { + this.condition = condition; + return this; + } + + /** + * Get the conditionVersion property: Version of the condition. Currently accepted value is '2.0'. + * + * @return the conditionVersion value. + */ + public String conditionVersion() { + return this.conditionVersion; + } + + /** + * Set the conditionVersion property: Version of the condition. Currently accepted value is '2.0'. + * + * @param conditionVersion the conditionVersion value to set. + * @return the RoleEligibilityScheduleInstanceProperties object itself. + */ + public RoleEligibilityScheduleInstanceProperties withConditionVersion(String conditionVersion) { + this.conditionVersion = conditionVersion; + return this; + } + + /** + * Get the createdOn property: DateTime when role eligibility schedule was created. + * + * @return the createdOn value. + */ + public OffsetDateTime createdOn() { + return this.createdOn; + } + + /** + * Set the createdOn property: DateTime when role eligibility schedule was created. + * + * @param createdOn the createdOn value to set. + * @return the RoleEligibilityScheduleInstanceProperties object itself. + */ + public RoleEligibilityScheduleInstanceProperties withCreatedOn(OffsetDateTime createdOn) { + this.createdOn = createdOn; + return this; + } + + /** + * Get the expandedProperties property: Additional properties of principal, scope and role definition. + * + * @return the expandedProperties value. + */ + public ExpandedProperties expandedProperties() { + return this.expandedProperties; + } + + /** + * Set the expandedProperties property: Additional properties of principal, scope and role definition. + * + * @param expandedProperties the expandedProperties value to set. + * @return the RoleEligibilityScheduleInstanceProperties object itself. + */ + public RoleEligibilityScheduleInstanceProperties withExpandedProperties(ExpandedProperties expandedProperties) { + this.expandedProperties = expandedProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (expandedProperties() != null) { + expandedProperties().validate(); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleEligibilityScheduleProperties.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleEligibilityScheduleProperties.java new file mode 100644 index 000000000000..60fc23cbd5f5 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleEligibilityScheduleProperties.java @@ -0,0 +1,405 @@ +// 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.ExpandedProperties; +import com.azure.resourcemanager.authorization.generated.models.MemberType; +import com.azure.resourcemanager.authorization.generated.models.PrincipalType; +import com.azure.resourcemanager.authorization.generated.models.Status; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Role eligibility schedule properties with scope. */ +@Fluent +public final class RoleEligibilityScheduleProperties { + /* + * The role eligibility schedule scope. + */ + @JsonProperty(value = "scope") + private String scope; + + /* + * The role definition ID. + */ + @JsonProperty(value = "roleDefinitionId") + private String roleDefinitionId; + + /* + * The principal ID. + */ + @JsonProperty(value = "principalId") + private String principalId; + + /* + * The principal type of the assigned principal ID. + */ + @JsonProperty(value = "principalType") + private PrincipalType principalType; + + /* + * The id of roleEligibilityScheduleRequest used to create this roleAssignmentSchedule + */ + @JsonProperty(value = "roleEligibilityScheduleRequestId") + private String roleEligibilityScheduleRequestId; + + /* + * Membership type of the role eligibility schedule + */ + @JsonProperty(value = "memberType") + private MemberType memberType; + + /* + * The status of the role eligibility schedule. + */ + @JsonProperty(value = "status") + private Status status; + + /* + * Start DateTime when role eligibility schedule + */ + @JsonProperty(value = "startDateTime") + private OffsetDateTime startDateTime; + + /* + * End DateTime when role eligibility schedule + */ + @JsonProperty(value = "endDateTime") + private OffsetDateTime endDateTime; + + /* + * The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: + * @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase + * 'foo_storage_container' + */ + @JsonProperty(value = "condition") + private String condition; + + /* + * Version of the condition. Currently accepted value is '2.0' + */ + @JsonProperty(value = "conditionVersion") + private String conditionVersion; + + /* + * DateTime when role eligibility schedule was created + */ + @JsonProperty(value = "createdOn") + private OffsetDateTime createdOn; + + /* + * DateTime when role eligibility schedule was modified + */ + @JsonProperty(value = "updatedOn") + private OffsetDateTime updatedOn; + + /* + * Additional properties of principal, scope and role definition + */ + @JsonProperty(value = "expandedProperties") + private ExpandedProperties expandedProperties; + + /** Creates an instance of RoleEligibilityScheduleProperties class. */ + public RoleEligibilityScheduleProperties() { + } + + /** + * Get the scope property: The role eligibility schedule scope. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope property: The role eligibility schedule scope. + * + * @param scope the scope value to set. + * @return the RoleEligibilityScheduleProperties object itself. + */ + public RoleEligibilityScheduleProperties withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the roleDefinitionId property: The role definition ID. + * + * @return the roleDefinitionId value. + */ + public String roleDefinitionId() { + return this.roleDefinitionId; + } + + /** + * Set the roleDefinitionId property: The role definition ID. + * + * @param roleDefinitionId the roleDefinitionId value to set. + * @return the RoleEligibilityScheduleProperties object itself. + */ + public RoleEligibilityScheduleProperties withRoleDefinitionId(String roleDefinitionId) { + this.roleDefinitionId = roleDefinitionId; + return this; + } + + /** + * Get the principalId property: The principal ID. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: The principal ID. + * + * @param principalId the principalId value to set. + * @return the RoleEligibilityScheduleProperties object itself. + */ + public RoleEligibilityScheduleProperties withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the principalType property: The principal type of the assigned principal ID. + * + * @return the principalType value. + */ + public PrincipalType principalType() { + return this.principalType; + } + + /** + * Set the principalType property: The principal type of the assigned principal ID. + * + * @param principalType the principalType value to set. + * @return the RoleEligibilityScheduleProperties object itself. + */ + public RoleEligibilityScheduleProperties withPrincipalType(PrincipalType principalType) { + this.principalType = principalType; + return this; + } + + /** + * Get the roleEligibilityScheduleRequestId property: The id of roleEligibilityScheduleRequest used to create this + * roleAssignmentSchedule. + * + * @return the roleEligibilityScheduleRequestId value. + */ + public String roleEligibilityScheduleRequestId() { + return this.roleEligibilityScheduleRequestId; + } + + /** + * Set the roleEligibilityScheduleRequestId property: The id of roleEligibilityScheduleRequest used to create this + * roleAssignmentSchedule. + * + * @param roleEligibilityScheduleRequestId the roleEligibilityScheduleRequestId value to set. + * @return the RoleEligibilityScheduleProperties object itself. + */ + public RoleEligibilityScheduleProperties withRoleEligibilityScheduleRequestId( + String roleEligibilityScheduleRequestId) { + this.roleEligibilityScheduleRequestId = roleEligibilityScheduleRequestId; + return this; + } + + /** + * Get the memberType property: Membership type of the role eligibility schedule. + * + * @return the memberType value. + */ + public MemberType memberType() { + return this.memberType; + } + + /** + * Set the memberType property: Membership type of the role eligibility schedule. + * + * @param memberType the memberType value to set. + * @return the RoleEligibilityScheduleProperties object itself. + */ + public RoleEligibilityScheduleProperties withMemberType(MemberType memberType) { + this.memberType = memberType; + return this; + } + + /** + * Get the status property: The status of the role eligibility schedule. + * + * @return the status value. + */ + public Status status() { + return this.status; + } + + /** + * Set the status property: The status of the role eligibility schedule. + * + * @param status the status value to set. + * @return the RoleEligibilityScheduleProperties object itself. + */ + public RoleEligibilityScheduleProperties withStatus(Status status) { + this.status = status; + return this; + } + + /** + * Get the startDateTime property: Start DateTime when role eligibility schedule. + * + * @return the startDateTime value. + */ + public OffsetDateTime startDateTime() { + return this.startDateTime; + } + + /** + * Set the startDateTime property: Start DateTime when role eligibility schedule. + * + * @param startDateTime the startDateTime value to set. + * @return the RoleEligibilityScheduleProperties object itself. + */ + public RoleEligibilityScheduleProperties withStartDateTime(OffsetDateTime startDateTime) { + this.startDateTime = startDateTime; + return this; + } + + /** + * Get the endDateTime property: End DateTime when role eligibility schedule. + * + * @return the endDateTime value. + */ + public OffsetDateTime endDateTime() { + return this.endDateTime; + } + + /** + * Set the endDateTime property: End DateTime when role eligibility schedule. + * + * @param endDateTime the endDateTime value to set. + * @return the RoleEligibilityScheduleProperties object itself. + */ + public RoleEligibilityScheduleProperties withEndDateTime(OffsetDateTime endDateTime) { + this.endDateTime = endDateTime; + return this; + } + + /** + * Get the condition property: The conditions on the role assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @return the condition value. + */ + public String condition() { + return this.condition; + } + + /** + * Set the condition property: The conditions on the role assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @param condition the condition value to set. + * @return the RoleEligibilityScheduleProperties object itself. + */ + public RoleEligibilityScheduleProperties withCondition(String condition) { + this.condition = condition; + return this; + } + + /** + * Get the conditionVersion property: Version of the condition. Currently accepted value is '2.0'. + * + * @return the conditionVersion value. + */ + public String conditionVersion() { + return this.conditionVersion; + } + + /** + * Set the conditionVersion property: Version of the condition. Currently accepted value is '2.0'. + * + * @param conditionVersion the conditionVersion value to set. + * @return the RoleEligibilityScheduleProperties object itself. + */ + public RoleEligibilityScheduleProperties withConditionVersion(String conditionVersion) { + this.conditionVersion = conditionVersion; + return this; + } + + /** + * Get the createdOn property: DateTime when role eligibility schedule was created. + * + * @return the createdOn value. + */ + public OffsetDateTime createdOn() { + return this.createdOn; + } + + /** + * Set the createdOn property: DateTime when role eligibility schedule was created. + * + * @param createdOn the createdOn value to set. + * @return the RoleEligibilityScheduleProperties object itself. + */ + public RoleEligibilityScheduleProperties withCreatedOn(OffsetDateTime createdOn) { + this.createdOn = createdOn; + return this; + } + + /** + * Get the updatedOn property: DateTime when role eligibility schedule was modified. + * + * @return the updatedOn value. + */ + public OffsetDateTime updatedOn() { + return this.updatedOn; + } + + /** + * Set the updatedOn property: DateTime when role eligibility schedule was modified. + * + * @param updatedOn the updatedOn value to set. + * @return the RoleEligibilityScheduleProperties object itself. + */ + public RoleEligibilityScheduleProperties withUpdatedOn(OffsetDateTime updatedOn) { + this.updatedOn = updatedOn; + return this; + } + + /** + * Get the expandedProperties property: Additional properties of principal, scope and role definition. + * + * @return the expandedProperties value. + */ + public ExpandedProperties expandedProperties() { + return this.expandedProperties; + } + + /** + * Set the expandedProperties property: Additional properties of principal, scope and role definition. + * + * @param expandedProperties the expandedProperties value to set. + * @return the RoleEligibilityScheduleProperties object itself. + */ + public RoleEligibilityScheduleProperties withExpandedProperties(ExpandedProperties expandedProperties) { + this.expandedProperties = expandedProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (expandedProperties() != null) { + expandedProperties().validate(); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleEligibilityScheduleRequestInner.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleEligibilityScheduleRequestInner.java new file mode 100644 index 000000000000..ad169aa91328 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleEligibilityScheduleRequestInner.java @@ -0,0 +1,401 @@ +// 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.ExpandedProperties; +import com.azure.resourcemanager.authorization.generated.models.PrincipalType; +import com.azure.resourcemanager.authorization.generated.models.RequestType; +import com.azure.resourcemanager.authorization.generated.models.RoleEligibilityScheduleRequestPropertiesScheduleInfo; +import com.azure.resourcemanager.authorization.generated.models.RoleEligibilityScheduleRequestPropertiesTicketInfo; +import com.azure.resourcemanager.authorization.generated.models.Status; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Role Eligibility schedule request. */ +@Fluent +public final class RoleEligibilityScheduleRequestInner { + /* + * The role eligibility schedule request ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The role eligibility schedule request name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The role eligibility schedule request type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Role eligibility schedule request properties. + */ + @JsonProperty(value = "properties") + private RoleEligibilityScheduleRequestProperties innerProperties; + + /** Creates an instance of RoleEligibilityScheduleRequestInner class. */ + public RoleEligibilityScheduleRequestInner() { + } + + /** + * Get the id property: The role eligibility schedule request ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The role eligibility schedule request name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: The role eligibility schedule request type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the innerProperties property: Role eligibility schedule request properties. + * + * @return the innerProperties value. + */ + private RoleEligibilityScheduleRequestProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the scope property: The role eligibility schedule request scope. + * + * @return the scope value. + */ + public String scope() { + return this.innerProperties() == null ? null : this.innerProperties().scope(); + } + + /** + * Get the roleDefinitionId property: The role definition ID. + * + * @return the roleDefinitionId value. + */ + public String roleDefinitionId() { + return this.innerProperties() == null ? null : this.innerProperties().roleDefinitionId(); + } + + /** + * Set the roleDefinitionId property: The role definition ID. + * + * @param roleDefinitionId the roleDefinitionId value to set. + * @return the RoleEligibilityScheduleRequestInner object itself. + */ + public RoleEligibilityScheduleRequestInner withRoleDefinitionId(String roleDefinitionId) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleEligibilityScheduleRequestProperties(); + } + this.innerProperties().withRoleDefinitionId(roleDefinitionId); + return this; + } + + /** + * Get the principalId property: The principal ID. + * + * @return the principalId value. + */ + public String principalId() { + return this.innerProperties() == null ? null : this.innerProperties().principalId(); + } + + /** + * Set the principalId property: The principal ID. + * + * @param principalId the principalId value to set. + * @return the RoleEligibilityScheduleRequestInner object itself. + */ + public RoleEligibilityScheduleRequestInner withPrincipalId(String principalId) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleEligibilityScheduleRequestProperties(); + } + this.innerProperties().withPrincipalId(principalId); + return this; + } + + /** + * Get the principalType property: The principal type of the assigned principal ID. + * + * @return the principalType value. + */ + public PrincipalType principalType() { + return this.innerProperties() == null ? null : this.innerProperties().principalType(); + } + + /** + * Get the requestType property: The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign + * etc. + * + * @return the requestType value. + */ + public RequestType requestType() { + return this.innerProperties() == null ? null : this.innerProperties().requestType(); + } + + /** + * Set the requestType property: The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign + * etc. + * + * @param requestType the requestType value to set. + * @return the RoleEligibilityScheduleRequestInner object itself. + */ + public RoleEligibilityScheduleRequestInner withRequestType(RequestType requestType) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleEligibilityScheduleRequestProperties(); + } + this.innerProperties().withRequestType(requestType); + return this; + } + + /** + * Get the status property: The status of the role eligibility schedule request. + * + * @return the status value. + */ + public Status status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the approvalId property: The approvalId of the role eligibility schedule request. + * + * @return the approvalId value. + */ + public String approvalId() { + return this.innerProperties() == null ? null : this.innerProperties().approvalId(); + } + + /** + * Get the scheduleInfo property: Schedule info of the role eligibility schedule. + * + * @return the scheduleInfo value. + */ + public RoleEligibilityScheduleRequestPropertiesScheduleInfo scheduleInfo() { + return this.innerProperties() == null ? null : this.innerProperties().scheduleInfo(); + } + + /** + * Set the scheduleInfo property: Schedule info of the role eligibility schedule. + * + * @param scheduleInfo the scheduleInfo value to set. + * @return the RoleEligibilityScheduleRequestInner object itself. + */ + public RoleEligibilityScheduleRequestInner withScheduleInfo( + RoleEligibilityScheduleRequestPropertiesScheduleInfo scheduleInfo) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleEligibilityScheduleRequestProperties(); + } + this.innerProperties().withScheduleInfo(scheduleInfo); + return this; + } + + /** + * Get the targetRoleEligibilityScheduleId property: The resultant role eligibility schedule id or the role + * eligibility schedule id being updated. + * + * @return the targetRoleEligibilityScheduleId value. + */ + public String targetRoleEligibilityScheduleId() { + return this.innerProperties() == null ? null : this.innerProperties().targetRoleEligibilityScheduleId(); + } + + /** + * Set the targetRoleEligibilityScheduleId property: The resultant role eligibility schedule id or the role + * eligibility schedule id being updated. + * + * @param targetRoleEligibilityScheduleId the targetRoleEligibilityScheduleId value to set. + * @return the RoleEligibilityScheduleRequestInner object itself. + */ + public RoleEligibilityScheduleRequestInner withTargetRoleEligibilityScheduleId( + String targetRoleEligibilityScheduleId) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleEligibilityScheduleRequestProperties(); + } + this.innerProperties().withTargetRoleEligibilityScheduleId(targetRoleEligibilityScheduleId); + return this; + } + + /** + * Get the targetRoleEligibilityScheduleInstanceId property: The role eligibility schedule instance id being + * updated. + * + * @return the targetRoleEligibilityScheduleInstanceId value. + */ + public String targetRoleEligibilityScheduleInstanceId() { + return this.innerProperties() == null ? null : this.innerProperties().targetRoleEligibilityScheduleInstanceId(); + } + + /** + * Set the targetRoleEligibilityScheduleInstanceId property: The role eligibility schedule instance id being + * updated. + * + * @param targetRoleEligibilityScheduleInstanceId the targetRoleEligibilityScheduleInstanceId value to set. + * @return the RoleEligibilityScheduleRequestInner object itself. + */ + public RoleEligibilityScheduleRequestInner withTargetRoleEligibilityScheduleInstanceId( + String targetRoleEligibilityScheduleInstanceId) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleEligibilityScheduleRequestProperties(); + } + this.innerProperties().withTargetRoleEligibilityScheduleInstanceId(targetRoleEligibilityScheduleInstanceId); + return this; + } + + /** + * Get the justification property: Justification for the role eligibility. + * + * @return the justification value. + */ + public String justification() { + return this.innerProperties() == null ? null : this.innerProperties().justification(); + } + + /** + * Set the justification property: Justification for the role eligibility. + * + * @param justification the justification value to set. + * @return the RoleEligibilityScheduleRequestInner object itself. + */ + public RoleEligibilityScheduleRequestInner withJustification(String justification) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleEligibilityScheduleRequestProperties(); + } + this.innerProperties().withJustification(justification); + return this; + } + + /** + * Get the ticketInfo property: Ticket Info of the role eligibility. + * + * @return the ticketInfo value. + */ + public RoleEligibilityScheduleRequestPropertiesTicketInfo ticketInfo() { + return this.innerProperties() == null ? null : this.innerProperties().ticketInfo(); + } + + /** + * Set the ticketInfo property: Ticket Info of the role eligibility. + * + * @param ticketInfo the ticketInfo value to set. + * @return the RoleEligibilityScheduleRequestInner object itself. + */ + public RoleEligibilityScheduleRequestInner withTicketInfo( + RoleEligibilityScheduleRequestPropertiesTicketInfo ticketInfo) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleEligibilityScheduleRequestProperties(); + } + this.innerProperties().withTicketInfo(ticketInfo); + return this; + } + + /** + * Get the condition property: The conditions on the role assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @return the condition value. + */ + public String condition() { + return this.innerProperties() == null ? null : this.innerProperties().condition(); + } + + /** + * Set the condition property: The conditions on the role assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @param condition the condition value to set. + * @return the RoleEligibilityScheduleRequestInner object itself. + */ + public RoleEligibilityScheduleRequestInner withCondition(String condition) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleEligibilityScheduleRequestProperties(); + } + this.innerProperties().withCondition(condition); + return this; + } + + /** + * Get the conditionVersion property: Version of the condition. Currently accepted value is '2.0'. + * + * @return the conditionVersion value. + */ + public String conditionVersion() { + return this.innerProperties() == null ? null : this.innerProperties().conditionVersion(); + } + + /** + * Set the conditionVersion property: Version of the condition. Currently accepted value is '2.0'. + * + * @param conditionVersion the conditionVersion value to set. + * @return the RoleEligibilityScheduleRequestInner object itself. + */ + public RoleEligibilityScheduleRequestInner withConditionVersion(String conditionVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleEligibilityScheduleRequestProperties(); + } + this.innerProperties().withConditionVersion(conditionVersion); + return this; + } + + /** + * Get the createdOn property: DateTime when role eligibility schedule request was created. + * + * @return the createdOn value. + */ + public OffsetDateTime createdOn() { + return this.innerProperties() == null ? null : this.innerProperties().createdOn(); + } + + /** + * Get the requestorId property: Id of the user who created this request. + * + * @return the requestorId value. + */ + public String requestorId() { + return this.innerProperties() == null ? null : this.innerProperties().requestorId(); + } + + /** + * Get the expandedProperties property: Additional properties of principal, scope and role definition. + * + * @return the expandedProperties value. + */ + public ExpandedProperties expandedProperties() { + return this.innerProperties() == null ? null : this.innerProperties().expandedProperties(); + } + + /** + * 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/RoleEligibilityScheduleRequestProperties.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleEligibilityScheduleRequestProperties.java new file mode 100644 index 000000000000..c027a46e3385 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleEligibilityScheduleRequestProperties.java @@ -0,0 +1,443 @@ +// 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.ExpandedProperties; +import com.azure.resourcemanager.authorization.generated.models.PrincipalType; +import com.azure.resourcemanager.authorization.generated.models.RequestType; +import com.azure.resourcemanager.authorization.generated.models.RoleEligibilityScheduleRequestPropertiesScheduleInfo; +import com.azure.resourcemanager.authorization.generated.models.RoleEligibilityScheduleRequestPropertiesTicketInfo; +import com.azure.resourcemanager.authorization.generated.models.Status; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Role eligibility schedule request properties with scope. */ +@Fluent +public final class RoleEligibilityScheduleRequestProperties { + /* + * The role eligibility schedule request scope. + */ + @JsonProperty(value = "scope", access = JsonProperty.Access.WRITE_ONLY) + private String scope; + + /* + * The role definition ID. + */ + @JsonProperty(value = "roleDefinitionId", required = true) + private String roleDefinitionId; + + /* + * The principal ID. + */ + @JsonProperty(value = "principalId", required = true) + private String principalId; + + /* + * The principal type of the assigned principal ID. + */ + @JsonProperty(value = "principalType", access = JsonProperty.Access.WRITE_ONLY) + private PrincipalType principalType; + + /* + * The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc + */ + @JsonProperty(value = "requestType", required = true) + private RequestType requestType; + + /* + * The status of the role eligibility schedule request. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private Status status; + + /* + * The approvalId of the role eligibility schedule request. + */ + @JsonProperty(value = "approvalId", access = JsonProperty.Access.WRITE_ONLY) + private String approvalId; + + /* + * Schedule info of the role eligibility schedule + */ + @JsonProperty(value = "scheduleInfo") + private RoleEligibilityScheduleRequestPropertiesScheduleInfo scheduleInfo; + + /* + * The resultant role eligibility schedule id or the role eligibility schedule id being updated + */ + @JsonProperty(value = "targetRoleEligibilityScheduleId") + private String targetRoleEligibilityScheduleId; + + /* + * The role eligibility schedule instance id being updated + */ + @JsonProperty(value = "targetRoleEligibilityScheduleInstanceId") + private String targetRoleEligibilityScheduleInstanceId; + + /* + * Justification for the role eligibility + */ + @JsonProperty(value = "justification") + private String justification; + + /* + * Ticket Info of the role eligibility + */ + @JsonProperty(value = "ticketInfo") + private RoleEligibilityScheduleRequestPropertiesTicketInfo ticketInfo; + + /* + * The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: + * @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase + * 'foo_storage_container' + */ + @JsonProperty(value = "condition") + private String condition; + + /* + * Version of the condition. Currently accepted value is '2.0' + */ + @JsonProperty(value = "conditionVersion") + private String conditionVersion; + + /* + * DateTime when role eligibility schedule request was created + */ + @JsonProperty(value = "createdOn", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdOn; + + /* + * Id of the user who created this request + */ + @JsonProperty(value = "requestorId", access = JsonProperty.Access.WRITE_ONLY) + private String requestorId; + + /* + * Additional properties of principal, scope and role definition + */ + @JsonProperty(value = "expandedProperties", access = JsonProperty.Access.WRITE_ONLY) + private ExpandedProperties expandedProperties; + + /** Creates an instance of RoleEligibilityScheduleRequestProperties class. */ + public RoleEligibilityScheduleRequestProperties() { + } + + /** + * Get the scope property: The role eligibility schedule request scope. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Get the roleDefinitionId property: The role definition ID. + * + * @return the roleDefinitionId value. + */ + public String roleDefinitionId() { + return this.roleDefinitionId; + } + + /** + * Set the roleDefinitionId property: The role definition ID. + * + * @param roleDefinitionId the roleDefinitionId value to set. + * @return the RoleEligibilityScheduleRequestProperties object itself. + */ + public RoleEligibilityScheduleRequestProperties withRoleDefinitionId(String roleDefinitionId) { + this.roleDefinitionId = roleDefinitionId; + return this; + } + + /** + * Get the principalId property: The principal ID. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: The principal ID. + * + * @param principalId the principalId value to set. + * @return the RoleEligibilityScheduleRequestProperties object itself. + */ + public RoleEligibilityScheduleRequestProperties withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the principalType property: The principal type of the assigned principal ID. + * + * @return the principalType value. + */ + public PrincipalType principalType() { + return this.principalType; + } + + /** + * Get the requestType property: The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign + * etc. + * + * @return the requestType value. + */ + public RequestType requestType() { + return this.requestType; + } + + /** + * Set the requestType property: The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign + * etc. + * + * @param requestType the requestType value to set. + * @return the RoleEligibilityScheduleRequestProperties object itself. + */ + public RoleEligibilityScheduleRequestProperties withRequestType(RequestType requestType) { + this.requestType = requestType; + return this; + } + + /** + * Get the status property: The status of the role eligibility schedule request. + * + * @return the status value. + */ + public Status status() { + return this.status; + } + + /** + * Get the approvalId property: The approvalId of the role eligibility schedule request. + * + * @return the approvalId value. + */ + public String approvalId() { + return this.approvalId; + } + + /** + * Get the scheduleInfo property: Schedule info of the role eligibility schedule. + * + * @return the scheduleInfo value. + */ + public RoleEligibilityScheduleRequestPropertiesScheduleInfo scheduleInfo() { + return this.scheduleInfo; + } + + /** + * Set the scheduleInfo property: Schedule info of the role eligibility schedule. + * + * @param scheduleInfo the scheduleInfo value to set. + * @return the RoleEligibilityScheduleRequestProperties object itself. + */ + public RoleEligibilityScheduleRequestProperties withScheduleInfo( + RoleEligibilityScheduleRequestPropertiesScheduleInfo scheduleInfo) { + this.scheduleInfo = scheduleInfo; + return this; + } + + /** + * Get the targetRoleEligibilityScheduleId property: The resultant role eligibility schedule id or the role + * eligibility schedule id being updated. + * + * @return the targetRoleEligibilityScheduleId value. + */ + public String targetRoleEligibilityScheduleId() { + return this.targetRoleEligibilityScheduleId; + } + + /** + * Set the targetRoleEligibilityScheduleId property: The resultant role eligibility schedule id or the role + * eligibility schedule id being updated. + * + * @param targetRoleEligibilityScheduleId the targetRoleEligibilityScheduleId value to set. + * @return the RoleEligibilityScheduleRequestProperties object itself. + */ + public RoleEligibilityScheduleRequestProperties withTargetRoleEligibilityScheduleId( + String targetRoleEligibilityScheduleId) { + this.targetRoleEligibilityScheduleId = targetRoleEligibilityScheduleId; + return this; + } + + /** + * Get the targetRoleEligibilityScheduleInstanceId property: The role eligibility schedule instance id being + * updated. + * + * @return the targetRoleEligibilityScheduleInstanceId value. + */ + public String targetRoleEligibilityScheduleInstanceId() { + return this.targetRoleEligibilityScheduleInstanceId; + } + + /** + * Set the targetRoleEligibilityScheduleInstanceId property: The role eligibility schedule instance id being + * updated. + * + * @param targetRoleEligibilityScheduleInstanceId the targetRoleEligibilityScheduleInstanceId value to set. + * @return the RoleEligibilityScheduleRequestProperties object itself. + */ + public RoleEligibilityScheduleRequestProperties withTargetRoleEligibilityScheduleInstanceId( + String targetRoleEligibilityScheduleInstanceId) { + this.targetRoleEligibilityScheduleInstanceId = targetRoleEligibilityScheduleInstanceId; + return this; + } + + /** + * Get the justification property: Justification for the role eligibility. + * + * @return the justification value. + */ + public String justification() { + return this.justification; + } + + /** + * Set the justification property: Justification for the role eligibility. + * + * @param justification the justification value to set. + * @return the RoleEligibilityScheduleRequestProperties object itself. + */ + public RoleEligibilityScheduleRequestProperties withJustification(String justification) { + this.justification = justification; + return this; + } + + /** + * Get the ticketInfo property: Ticket Info of the role eligibility. + * + * @return the ticketInfo value. + */ + public RoleEligibilityScheduleRequestPropertiesTicketInfo ticketInfo() { + return this.ticketInfo; + } + + /** + * Set the ticketInfo property: Ticket Info of the role eligibility. + * + * @param ticketInfo the ticketInfo value to set. + * @return the RoleEligibilityScheduleRequestProperties object itself. + */ + public RoleEligibilityScheduleRequestProperties withTicketInfo( + RoleEligibilityScheduleRequestPropertiesTicketInfo ticketInfo) { + this.ticketInfo = ticketInfo; + return this; + } + + /** + * Get the condition property: The conditions on the role assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @return the condition value. + */ + public String condition() { + return this.condition; + } + + /** + * Set the condition property: The conditions on the role assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @param condition the condition value to set. + * @return the RoleEligibilityScheduleRequestProperties object itself. + */ + public RoleEligibilityScheduleRequestProperties withCondition(String condition) { + this.condition = condition; + return this; + } + + /** + * Get the conditionVersion property: Version of the condition. Currently accepted value is '2.0'. + * + * @return the conditionVersion value. + */ + public String conditionVersion() { + return this.conditionVersion; + } + + /** + * Set the conditionVersion property: Version of the condition. Currently accepted value is '2.0'. + * + * @param conditionVersion the conditionVersion value to set. + * @return the RoleEligibilityScheduleRequestProperties object itself. + */ + public RoleEligibilityScheduleRequestProperties withConditionVersion(String conditionVersion) { + this.conditionVersion = conditionVersion; + return this; + } + + /** + * Get the createdOn property: DateTime when role eligibility schedule request was created. + * + * @return the createdOn value. + */ + public OffsetDateTime createdOn() { + return this.createdOn; + } + + /** + * Get the requestorId property: Id of the user who created this request. + * + * @return the requestorId value. + */ + public String requestorId() { + return this.requestorId; + } + + /** + * Get the expandedProperties property: Additional properties of principal, scope and role definition. + * + * @return the expandedProperties value. + */ + public ExpandedProperties expandedProperties() { + return this.expandedProperties; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (roleDefinitionId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property roleDefinitionId in model" + + " RoleEligibilityScheduleRequestProperties")); + } + if (principalId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property principalId in model RoleEligibilityScheduleRequestProperties")); + } + if (requestType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property requestType in model RoleEligibilityScheduleRequestProperties")); + } + if (scheduleInfo() != null) { + scheduleInfo().validate(); + } + if (ticketInfo() != null) { + ticketInfo().validate(); + } + if (expandedProperties() != null) { + expandedProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RoleEligibilityScheduleRequestProperties.class); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleManagementPolicyAssignmentInner.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleManagementPolicyAssignmentInner.java new file mode 100644 index 000000000000..5331866de183 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleManagementPolicyAssignmentInner.java @@ -0,0 +1,166 @@ +// 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.PolicyAssignmentProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Role management policy. */ +@Fluent +public final class RoleManagementPolicyAssignmentInner { + /* + * The role management policy Id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The role management policy name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The role management policy type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Role management policy properties. + */ + @JsonProperty(value = "properties") + private RoleManagementPolicyAssignmentProperties innerProperties; + + /** Creates an instance of RoleManagementPolicyAssignmentInner class. */ + public RoleManagementPolicyAssignmentInner() { + } + + /** + * Get the id property: The role management policy Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The role management policy name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: The role management policy type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the innerProperties property: Role management policy properties. + * + * @return the innerProperties value. + */ + private RoleManagementPolicyAssignmentProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the scope property: The role management policy scope. + * + * @return the scope value. + */ + public String scope() { + return this.innerProperties() == null ? null : this.innerProperties().scope(); + } + + /** + * Set the scope property: The role management policy scope. + * + * @param scope the scope value to set. + * @return the RoleManagementPolicyAssignmentInner object itself. + */ + public RoleManagementPolicyAssignmentInner withScope(String scope) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleManagementPolicyAssignmentProperties(); + } + this.innerProperties().withScope(scope); + return this; + } + + /** + * Get the roleDefinitionId property: The role definition of management policy assignment. + * + * @return the roleDefinitionId value. + */ + public String roleDefinitionId() { + return this.innerProperties() == null ? null : this.innerProperties().roleDefinitionId(); + } + + /** + * Set the roleDefinitionId property: The role definition of management policy assignment. + * + * @param roleDefinitionId the roleDefinitionId value to set. + * @return the RoleManagementPolicyAssignmentInner object itself. + */ + public RoleManagementPolicyAssignmentInner withRoleDefinitionId(String roleDefinitionId) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleManagementPolicyAssignmentProperties(); + } + this.innerProperties().withRoleDefinitionId(roleDefinitionId); + return this; + } + + /** + * Get the policyId property: The policy id role management policy assignment. + * + * @return the policyId value. + */ + public String policyId() { + return this.innerProperties() == null ? null : this.innerProperties().policyId(); + } + + /** + * Set the policyId property: The policy id role management policy assignment. + * + * @param policyId the policyId value to set. + * @return the RoleManagementPolicyAssignmentInner object itself. + */ + public RoleManagementPolicyAssignmentInner withPolicyId(String policyId) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleManagementPolicyAssignmentProperties(); + } + this.innerProperties().withPolicyId(policyId); + return this; + } + + /** + * Get the policyAssignmentProperties property: Additional properties of scope, role definition and policy. + * + * @return the policyAssignmentProperties value. + */ + public PolicyAssignmentProperties policyAssignmentProperties() { + return this.innerProperties() == null ? null : this.innerProperties().policyAssignmentProperties(); + } + + /** + * 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/RoleManagementPolicyAssignmentProperties.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleManagementPolicyAssignmentProperties.java new file mode 100644 index 000000000000..6b57d0a38fae --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleManagementPolicyAssignmentProperties.java @@ -0,0 +1,121 @@ +// 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.PolicyAssignmentProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Role management policy assignment properties with scope. */ +@Fluent +public final class RoleManagementPolicyAssignmentProperties { + /* + * The role management policy scope. + */ + @JsonProperty(value = "scope") + private String scope; + + /* + * The role definition of management policy assignment. + */ + @JsonProperty(value = "roleDefinitionId") + private String roleDefinitionId; + + /* + * The policy id role management policy assignment. + */ + @JsonProperty(value = "policyId") + private String policyId; + + /* + * Additional properties of scope, role definition and policy + */ + @JsonProperty(value = "policyAssignmentProperties", access = JsonProperty.Access.WRITE_ONLY) + private PolicyAssignmentProperties policyAssignmentProperties; + + /** Creates an instance of RoleManagementPolicyAssignmentProperties class. */ + public RoleManagementPolicyAssignmentProperties() { + } + + /** + * Get the scope property: The role management policy scope. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope property: The role management policy scope. + * + * @param scope the scope value to set. + * @return the RoleManagementPolicyAssignmentProperties object itself. + */ + public RoleManagementPolicyAssignmentProperties withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the roleDefinitionId property: The role definition of management policy assignment. + * + * @return the roleDefinitionId value. + */ + public String roleDefinitionId() { + return this.roleDefinitionId; + } + + /** + * Set the roleDefinitionId property: The role definition of management policy assignment. + * + * @param roleDefinitionId the roleDefinitionId value to set. + * @return the RoleManagementPolicyAssignmentProperties object itself. + */ + public RoleManagementPolicyAssignmentProperties withRoleDefinitionId(String roleDefinitionId) { + this.roleDefinitionId = roleDefinitionId; + return this; + } + + /** + * Get the policyId property: The policy id role management policy assignment. + * + * @return the policyId value. + */ + public String policyId() { + return this.policyId; + } + + /** + * Set the policyId property: The policy id role management policy assignment. + * + * @param policyId the policyId value to set. + * @return the RoleManagementPolicyAssignmentProperties object itself. + */ + public RoleManagementPolicyAssignmentProperties withPolicyId(String policyId) { + this.policyId = policyId; + return this; + } + + /** + * Get the policyAssignmentProperties property: Additional properties of scope, role definition and policy. + * + * @return the policyAssignmentProperties value. + */ + public PolicyAssignmentProperties policyAssignmentProperties() { + return this.policyAssignmentProperties; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (policyAssignmentProperties() != null) { + policyAssignmentProperties().validate(); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleManagementPolicyInner.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleManagementPolicyInner.java new file mode 100644 index 000000000000..6a1135ab40e1 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleManagementPolicyInner.java @@ -0,0 +1,243 @@ +// 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.PolicyProperties; +import com.azure.resourcemanager.authorization.generated.models.Principal; +import com.azure.resourcemanager.authorization.generated.models.RoleManagementPolicyRule; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Role management policy. */ +@Fluent +public final class RoleManagementPolicyInner { + /* + * The role management policy Id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The role management policy name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The role management policy type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Role management policy properties. + */ + @JsonProperty(value = "properties") + private RoleManagementPolicyProperties innerProperties; + + /** Creates an instance of RoleManagementPolicyInner class. */ + public RoleManagementPolicyInner() { + } + + /** + * Get the id property: The role management policy Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The role management policy name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: The role management policy type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the innerProperties property: Role management policy properties. + * + * @return the innerProperties value. + */ + private RoleManagementPolicyProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the scope property: The role management policy scope. + * + * @return the scope value. + */ + public String scope() { + return this.innerProperties() == null ? null : this.innerProperties().scope(); + } + + /** + * Set the scope property: The role management policy scope. + * + * @param scope the scope value to set. + * @return the RoleManagementPolicyInner object itself. + */ + public RoleManagementPolicyInner withScope(String scope) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleManagementPolicyProperties(); + } + this.innerProperties().withScope(scope); + return this; + } + + /** + * Get the displayName property: The role management policy display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Set the displayName property: The role management policy display name. + * + * @param displayName the displayName value to set. + * @return the RoleManagementPolicyInner object itself. + */ + public RoleManagementPolicyInner withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleManagementPolicyProperties(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } + + /** + * Get the description property: The role management policy description. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: The role management policy description. + * + * @param description the description value to set. + * @return the RoleManagementPolicyInner object itself. + */ + public RoleManagementPolicyInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleManagementPolicyProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the isOrganizationDefault property: The role management policy is default policy. + * + * @return the isOrganizationDefault value. + */ + public Boolean isOrganizationDefault() { + return this.innerProperties() == null ? null : this.innerProperties().isOrganizationDefault(); + } + + /** + * Set the isOrganizationDefault property: The role management policy is default policy. + * + * @param isOrganizationDefault the isOrganizationDefault value to set. + * @return the RoleManagementPolicyInner object itself. + */ + public RoleManagementPolicyInner withIsOrganizationDefault(Boolean isOrganizationDefault) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleManagementPolicyProperties(); + } + this.innerProperties().withIsOrganizationDefault(isOrganizationDefault); + return this; + } + + /** + * Get the lastModifiedBy property: The name of the entity last modified it. + * + * @return the lastModifiedBy value. + */ + public Principal lastModifiedBy() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedBy(); + } + + /** + * Get the lastModifiedDateTime property: The last modified date time. + * + * @return the lastModifiedDateTime value. + */ + public OffsetDateTime lastModifiedDateTime() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedDateTime(); + } + + /** + * Get the rules property: The rule applied to the policy. + * + * @return the rules value. + */ + public List rules() { + return this.innerProperties() == null ? null : this.innerProperties().rules(); + } + + /** + * Set the rules property: The rule applied to the policy. + * + * @param rules the rules value to set. + * @return the RoleManagementPolicyInner object itself. + */ + public RoleManagementPolicyInner withRules(List rules) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleManagementPolicyProperties(); + } + this.innerProperties().withRules(rules); + return this; + } + + /** + * Get the effectiveRules property: The readonly computed rule applied to the policy. + * + * @return the effectiveRules value. + */ + public List effectiveRules() { + return this.innerProperties() == null ? null : this.innerProperties().effectiveRules(); + } + + /** + * Get the policyProperties property: Additional properties of scope. + * + * @return the policyProperties value. + */ + public PolicyProperties policyProperties() { + return this.innerProperties() == null ? null : this.innerProperties().policyProperties(); + } + + /** + * 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/RoleManagementPolicyProperties.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleManagementPolicyProperties.java new file mode 100644 index 000000000000..b1c3398fbbac --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/models/RoleManagementPolicyProperties.java @@ -0,0 +1,231 @@ +// 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.PolicyProperties; +import com.azure.resourcemanager.authorization.generated.models.Principal; +import com.azure.resourcemanager.authorization.generated.models.RoleManagementPolicyRule; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Role management policy properties with scope. */ +@Fluent +public final class RoleManagementPolicyProperties { + /* + * The role management policy scope. + */ + @JsonProperty(value = "scope") + private String scope; + + /* + * The role management policy display name. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * The role management policy description. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The role management policy is default policy. + */ + @JsonProperty(value = "isOrganizationDefault") + private Boolean isOrganizationDefault; + + /* + * The name of the entity last modified it + */ + @JsonProperty(value = "lastModifiedBy", access = JsonProperty.Access.WRITE_ONLY) + private Principal lastModifiedBy; + + /* + * The last modified date time. + */ + @JsonProperty(value = "lastModifiedDateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastModifiedDateTime; + + /* + * The rule applied to the policy. + */ + @JsonProperty(value = "rules") + private List rules; + + /* + * The readonly computed rule applied to the policy. + */ + @JsonProperty(value = "effectiveRules", access = JsonProperty.Access.WRITE_ONLY) + private List effectiveRules; + + /* + * Additional properties of scope + */ + @JsonProperty(value = "policyProperties", access = JsonProperty.Access.WRITE_ONLY) + private PolicyProperties policyProperties; + + /** Creates an instance of RoleManagementPolicyProperties class. */ + public RoleManagementPolicyProperties() { + } + + /** + * Get the scope property: The role management policy scope. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope property: The role management policy scope. + * + * @param scope the scope value to set. + * @return the RoleManagementPolicyProperties object itself. + */ + public RoleManagementPolicyProperties withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the displayName property: The role management policy display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The role management policy display name. + * + * @param displayName the displayName value to set. + * @return the RoleManagementPolicyProperties object itself. + */ + public RoleManagementPolicyProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the description property: The role management policy description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The role management policy description. + * + * @param description the description value to set. + * @return the RoleManagementPolicyProperties object itself. + */ + public RoleManagementPolicyProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the isOrganizationDefault property: The role management policy is default policy. + * + * @return the isOrganizationDefault value. + */ + public Boolean isOrganizationDefault() { + return this.isOrganizationDefault; + } + + /** + * Set the isOrganizationDefault property: The role management policy is default policy. + * + * @param isOrganizationDefault the isOrganizationDefault value to set. + * @return the RoleManagementPolicyProperties object itself. + */ + public RoleManagementPolicyProperties withIsOrganizationDefault(Boolean isOrganizationDefault) { + this.isOrganizationDefault = isOrganizationDefault; + return this; + } + + /** + * Get the lastModifiedBy property: The name of the entity last modified it. + * + * @return the lastModifiedBy value. + */ + public Principal lastModifiedBy() { + return this.lastModifiedBy; + } + + /** + * Get the lastModifiedDateTime property: The last modified date time. + * + * @return the lastModifiedDateTime value. + */ + public OffsetDateTime lastModifiedDateTime() { + return this.lastModifiedDateTime; + } + + /** + * Get the rules property: The rule applied to the policy. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: The rule applied to the policy. + * + * @param rules the rules value to set. + * @return the RoleManagementPolicyProperties object itself. + */ + public RoleManagementPolicyProperties withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Get the effectiveRules property: The readonly computed rule applied to the policy. + * + * @return the effectiveRules value. + */ + public List effectiveRules() { + return this.effectiveRules; + } + + /** + * Get the policyProperties property: Additional properties of scope. + * + * @return the policyProperties value. + */ + public PolicyProperties policyProperties() { + return this.policyProperties; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (lastModifiedBy() != null) { + lastModifiedBy().validate(); + } + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + if (effectiveRules() != null) { + effectiveRules().forEach(e -> e.validate()); + } + if (policyProperties() != null) { + policyProperties().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 000000000000..42cbb3db76c9 --- /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,11 @@ +// 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. Role based access control provides you a + * way to apply granular level policy administration down to individual resources or resource groups. These operations + * enable you to manage role definitions and role assignments. A role definition describes the set of actions that can + * be performed on resources. A role assignment grants access to Azure Active Directory users. + */ +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 000000000000..ae01ced5b278 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/fluent/package-info.java @@ -0,0 +1,11 @@ +// 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. Role based access control provides you a + * way to apply granular level policy administration down to individual resources or resource groups. These operations + * enable you to manage role definitions and role assignments. A role definition describes the set of actions that can + * be performed on resources. A role assignment grants access to Azure Active Directory users. + */ +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 000000000000..f4b623dbe7a3 --- /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 000000000000..b43ff3000071 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewDecisionImpl.java @@ -0,0 +1,142 @@ +// 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.AccessReviewDecisionIdentity; +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 AccessReviewDecisionIdentity principal() { + return this.innerModel().principal(); + } + + 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 DecisionResourceType typePropertiesType() { + return this.innerModel().typePropertiesType(); + } + + public String idPropertiesId() { + return this.innerModel().idPropertiesId(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + 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 000000000000..fa4e23360395 --- /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 000000000000..2aab67236f33 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewDefaultSettingsOperationsClientImpl.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.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") + public 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, 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. + * + * @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. + * + * @throws ManagementException thrown 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 getWithResponse(Context.NONE).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 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .put( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .put(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, 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. + * @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(); + } + + /** + * 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 putWithResponse(properties, Context.NONE).getValue(); + } +} 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 000000000000..5ed28085c0b9 --- /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 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 get() { + AccessReviewDefaultSettingsInner inner = this.serviceClient().get(); + 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; + } + } + + public AccessReviewDefaultSettings put(AccessReviewScheduleSettings properties) { + AccessReviewDefaultSettingsInner inner = this.serviceClient().put(properties); + if (inner != null) { + return new AccessReviewDefaultSettingsImpl(inner, 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 000000000000..d9e1f493b9cf --- /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 000000000000..646bd4197f38 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionInstancesClientImpl.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.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") + public 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .generateDownloadUri( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + historyDefinitionId, + instanceId, + apiVersion, + 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .generateDownloadUri( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + historyDefinitionId, + instanceId, + apiVersion, + 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. + * @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(); + } + + /** + * 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 generateDownloadUriWithResponse(historyDefinitionId, instanceId, Context.NONE).getValue(); + } +} 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 000000000000..4c4d018d2e51 --- /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 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; + } + } + + 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; + } + } + + 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 000000000000..1433bf314062 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionInstancesOperationsClientImpl.java @@ -0,0 +1,335 @@ +// 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") + public 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + historyDefinitionId, + apiVersion, + 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + historyDefinitionId, + apiVersion, + 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 000000000000..cbf1260caa6e --- /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 000000000000..7a81c0afc8b8 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionOperationsClientImpl.java @@ -0,0 +1,368 @@ +// 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") + public 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + historyDefinitionId, + apiVersion, + 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + historyDefinitionId, + apiVersion, + 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. + * @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(); + } + + /** + * 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 createWithResponse(historyDefinitionId, properties, Context.NONE).getValue(); + } + + /** + * 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteById( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + historyDefinitionId, + apiVersion, + 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteById( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + historyDefinitionId, + apiVersion, + 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. + * @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(); + } + + /** + * 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) { + deleteByIdWithResponse(historyDefinitionId, Context.NONE); + } +} 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 000000000000..264cdc501ff8 --- /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 Response deleteByIdWithResponse(String historyDefinitionId, Context context) { + return this.serviceClient().deleteByIdWithResponse(historyDefinitionId, context); + } + + public void deleteById(String historyDefinitionId) { + this.serviceClient().deleteById(historyDefinitionId); + } + + 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 000000000000..a12ce7f665f7 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewHistoryDefinitionsClientImpl.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.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") + public 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getById( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + historyDefinitionId, + apiVersion, + 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getById( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + historyDefinitionId, + apiVersion, + 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. + * @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 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 getByIdWithResponse(historyDefinitionId, Context.NONE).getValue(); + } + + /** + * 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 000000000000..f3436c15aa83 --- /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 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; + } + } + + public AccessReviewHistoryDefinition getById(String historyDefinitionId) { + AccessReviewHistoryDefinitionInner inner = this.serviceClient().getById(historyDefinitionId); + if (inner != null) { + return new AccessReviewHistoryDefinitionImpl(inner, 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 000000000000..214c86e05bb7 --- /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 000000000000..63cd1d4ef291 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceContactedReviewersClientImpl.java @@ -0,0 +1,350 @@ +// 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") + public 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + id, + apiVersion, + 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + id, + apiVersion, + 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 000000000000..2c1ffa889fcd --- /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 000000000000..d2f5fcf5771b --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceDecisionsClientImpl.java @@ -0,0 +1,381 @@ +// 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") + public 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + id, + apiVersion, + 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + id, + apiVersion, + 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 000000000000..c34194624a1f --- /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 000000000000..2ce04afee32b --- /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 000000000000..716a36b5d6f4 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceMyDecisionsClientImpl.java @@ -0,0 +1,692 @@ +// 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") + public 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), scheduleDefinitionId, id, apiVersion, 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), scheduleDefinitionId, id, apiVersion, 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getById( + this.client.getEndpoint(), + scheduleDefinitionId, + id, + decisionId, + apiVersion, + 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getById(this.client.getEndpoint(), scheduleDefinitionId, id, decisionId, apiVersion, 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. + * @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(); + } + + /** + * 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 getByIdWithResponse(scheduleDefinitionId, id, decisionId, Context.NONE).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 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .patch( + this.client.getEndpoint(), + scheduleDefinitionId, + id, + decisionId, + apiVersion, + 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .patch( + this.client.getEndpoint(), + scheduleDefinitionId, + id, + decisionId, + apiVersion, + 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. + * @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(); + } + + /** + * 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 patchWithResponse(scheduleDefinitionId, id, decisionId, properties, Context.NONE).getValue(); + } + + /** + * 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 000000000000..5c6ad468188b --- /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 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 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 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; + } + } + + 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; + } + } + + 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 000000000000..c0adfc52a4ec --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstanceOperationsClientImpl.java @@ -0,0 +1,800 @@ +// 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") + public 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .stop( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + id, + apiVersion, + 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stop( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + id, + apiVersion, + 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. + * @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 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) { + stopWithResponse(scheduleDefinitionId, id, Context.NONE); + } + + /** + * 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .resetDecisions( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + id, + apiVersion, + 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .resetDecisions( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + id, + apiVersion, + 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. + * @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 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) { + resetDecisionsWithResponse(scheduleDefinitionId, id, Context.NONE); + } + + /** + * 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .applyDecisions( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + id, + apiVersion, + 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .applyDecisions( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + id, + apiVersion, + 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. + * @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 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) { + applyDecisionsWithResponse(scheduleDefinitionId, id, Context.NONE); + } + + /** + * 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .sendReminders( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + id, + apiVersion, + 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .sendReminders( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + id, + apiVersion, + 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. + * @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 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) { + sendRemindersWithResponse(scheduleDefinitionId, id, Context.NONE); + } + + /** + * 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .acceptRecommendations( + this.client.getEndpoint(), scheduleDefinitionId, id, apiVersion, 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .acceptRecommendations(this.client.getEndpoint(), scheduleDefinitionId, id, apiVersion, 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. + * @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(); + } + + /** + * 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) { + acceptRecommendationsWithResponse(scheduleDefinitionId, id, Context.NONE); + } +} 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 000000000000..7b8cf55977de --- /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 Response stopWithResponse(String scheduleDefinitionId, String id, Context context) { + return this.serviceClient().stopWithResponse(scheduleDefinitionId, id, context); + } + + public void stop(String scheduleDefinitionId, String id) { + this.serviceClient().stop(scheduleDefinitionId, id); + } + + public Response resetDecisionsWithResponse(String scheduleDefinitionId, String id, Context context) { + return this.serviceClient().resetDecisionsWithResponse(scheduleDefinitionId, id, context); + } + + public void resetDecisions(String scheduleDefinitionId, String id) { + this.serviceClient().resetDecisions(scheduleDefinitionId, id); + } + + public Response applyDecisionsWithResponse(String scheduleDefinitionId, String id, Context context) { + return this.serviceClient().applyDecisionsWithResponse(scheduleDefinitionId, id, context); + } + + public void applyDecisions(String scheduleDefinitionId, String id) { + this.serviceClient().applyDecisions(scheduleDefinitionId, id); + } + + public Response sendRemindersWithResponse(String scheduleDefinitionId, String id, Context context) { + return this.serviceClient().sendRemindersWithResponse(scheduleDefinitionId, id, context); + } + + public void sendReminders(String scheduleDefinitionId, String id) { + this.serviceClient().sendReminders(scheduleDefinitionId, id); + } + + public Response acceptRecommendationsWithResponse(String scheduleDefinitionId, String id, Context context) { + return this.serviceClient().acceptRecommendationsWithResponse(scheduleDefinitionId, id, context); + } + + public void acceptRecommendations(String scheduleDefinitionId, String id) { + this.serviceClient().acceptRecommendations(scheduleDefinitionId, id); + } + + 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 000000000000..453b8c370928 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstancesAssignedForMyApprovalsClientImpl.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.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") + public 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service.list(this.client.getEndpoint(), scheduleDefinitionId, apiVersion, 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), scheduleDefinitionId, apiVersion, 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service.getById(this.client.getEndpoint(), scheduleDefinitionId, id, apiVersion, 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getById(this.client.getEndpoint(), scheduleDefinitionId, id, apiVersion, 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. + * @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 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 getByIdWithResponse(scheduleDefinitionId, id, Context.NONE).getValue(); + } + + /** + * 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 000000000000..a0ce71377834 --- /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 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; + } + } + + 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; + } + } + + 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 000000000000..72c2b1a75051 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AccessReviewInstancesClientImpl.java @@ -0,0 +1,696 @@ +// 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") + public 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + apiVersion, + 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + apiVersion, + 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getById( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + id, + apiVersion, + 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getById( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + id, + apiVersion, + 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. + * @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(); + } + + /** + * 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 getByIdWithResponse(scheduleDefinitionId, id, Context.NONE).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 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + id, + apiVersion, + 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + id, + apiVersion, + 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. + * @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(); + } + + /** + * 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 createWithResponse(scheduleDefinitionId, id, properties, Context.NONE).getValue(); + } + + /** + * 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 000000000000..10c13d0d20a3 --- /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 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; + } + } + + 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; + } + } + + 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 000000000000..91215bb0e581 --- /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 Response stopWithResponse(Context context) { + return serviceManager.accessReviewScheduleDefinitions().stopWithResponse(scheduleDefinitionId, context); + } + + public void stop() { + serviceManager.accessReviewScheduleDefinitions().stop(scheduleDefinitionId); + } + + 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 000000000000..27d01570d58f --- /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") + public 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, 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 000000000000..b19783e7d993 --- /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 000000000000..2c1064e6c847 --- /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") + public 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getById( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + apiVersion, + 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getById( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + apiVersion, + 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. + * @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(); + } + + /** + * 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 getByIdWithResponse(scheduleDefinitionId, Context.NONE).getValue(); + } + + /** + * 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteById( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + apiVersion, + 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteById( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + apiVersion, + 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. + * @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(); + } + + /** + * 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) { + deleteByIdWithResponse(scheduleDefinitionId, Context.NONE); + } + + /** + * 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdateById( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + apiVersion, + 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdateById( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + apiVersion, + 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. + * @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(); + } + + /** + * 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 createOrUpdateByIdWithResponse(scheduleDefinitionId, properties, Context.NONE).getValue(); + } + + /** + * 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .stop( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + apiVersion, + 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stop( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + scheduleDefinitionId, + apiVersion, + 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. + * @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(); + } + + /** + * 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) { + stopWithResponse(scheduleDefinitionId, Context.NONE); + } + + /** + * 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 000000000000..4f5574134f8f --- /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 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 AccessReviewScheduleDefinition getById(String scheduleDefinitionId) { + AccessReviewScheduleDefinitionInner inner = this.serviceClient().getById(scheduleDefinitionId); + if (inner != null) { + return new AccessReviewScheduleDefinitionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteByIdWithResponse(String scheduleDefinitionId, Context context) { + return this.serviceClient().deleteByIdWithResponse(scheduleDefinitionId, context); + } + + public void deleteById(String scheduleDefinitionId) { + this.serviceClient().deleteById(scheduleDefinitionId); + } + + public Response stopWithResponse(String scheduleDefinitionId, Context context) { + return this.serviceClient().stopWithResponse(scheduleDefinitionId, context); + } + + public void stop(String scheduleDefinitionId) { + this.serviceClient().stop(scheduleDefinitionId); + } + + 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/AlertConfigurationImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertConfigurationImpl.java new file mode 100644 index 000000000000..56eb7278638b --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertConfigurationImpl.java @@ -0,0 +1,52 @@ +// 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.AlertConfigurationInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AlertConfigurationPropertiesInner; +import com.azure.resourcemanager.authorization.generated.models.AlertConfiguration; +import com.azure.resourcemanager.authorization.generated.models.AlertConfigurationProperties; + +public final class AlertConfigurationImpl implements AlertConfiguration { + private AlertConfigurationInner innerObject; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + AlertConfigurationImpl( + AlertConfigurationInner 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 AlertConfigurationProperties properties() { + AlertConfigurationPropertiesInner inner = this.innerModel().properties(); + if (inner != null) { + return new AlertConfigurationPropertiesImpl(inner, this.manager()); + } else { + return null; + } + } + + public AlertConfigurationInner 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/AlertConfigurationPropertiesImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertConfigurationPropertiesImpl.java new file mode 100644 index 000000000000..9e819ca855f3 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertConfigurationPropertiesImpl.java @@ -0,0 +1,52 @@ +// 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.AlertConfigurationPropertiesInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AlertDefinitionInner; +import com.azure.resourcemanager.authorization.generated.models.AlertConfigurationProperties; +import com.azure.resourcemanager.authorization.generated.models.AlertDefinition; + +public final class AlertConfigurationPropertiesImpl implements AlertConfigurationProperties { + private AlertConfigurationPropertiesInner innerObject; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + AlertConfigurationPropertiesImpl( + AlertConfigurationPropertiesInner innerObject, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String alertDefinitionId() { + return this.innerModel().alertDefinitionId(); + } + + public String scope() { + return this.innerModel().scope(); + } + + public Boolean isEnabled() { + return this.innerModel().isEnabled(); + } + + public AlertDefinition alertDefinition() { + AlertDefinitionInner inner = this.innerModel().alertDefinition(); + if (inner != null) { + return new AlertDefinitionImpl(inner, this.manager()); + } else { + return null; + } + } + + public AlertConfigurationPropertiesInner 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/AlertConfigurationsClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertConfigurationsClientImpl.java new file mode 100644 index 000000000000..b126415e33d9 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertConfigurationsClientImpl.java @@ -0,0 +1,580 @@ +// 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.AlertConfigurationsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AlertConfigurationInner; +import com.azure.resourcemanager.authorization.generated.models.AlertConfigurationListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AlertConfigurationsClient. */ +public final class AlertConfigurationsClientImpl implements AlertConfigurationsClient { + /** The proxy service used to perform REST calls. */ + private final AlertConfigurationsService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of AlertConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AlertConfigurationsClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy.create(AlertConfigurationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AuthorizationManagementClientAlertConfigurations to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + public interface AlertConfigurationsService { + @Headers({"Content-Type: application/json"}) + @Get("/{scope}/providers/Microsoft.Authorization/roleManagementAlertConfigurations/{alertId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam(value = "alertId", encoded = true) String alertId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch("/{scope}/providers/Microsoft.Authorization/roleManagementAlertConfigurations/{alertId}") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam(value = "alertId", encoded = true) String alertId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AlertConfigurationInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/{scope}/providers/Microsoft.Authorization/roleManagementAlertConfigurations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForScope( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForScopeNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the specified alert configuration. + * + * @param scope The scope of the alert configuration. The scope can be any REST resource instance. For example, use + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param alertId The name of the alert configuration to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified alert configuration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String scope, String alertId) { + 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 (alertId == null) { + return Mono.error(new IllegalArgumentException("Parameter alertId is required and cannot be null.")); + } + final String apiVersion = "2022-08-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), scope, alertId, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the specified alert configuration. + * + * @param scope The scope of the alert configuration. The scope can be any REST resource instance. For example, use + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param alertId The name of the alert configuration to get. + * @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 specified alert configuration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String scope, String alertId, 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 (alertId == null) { + return Mono.error(new IllegalArgumentException("Parameter alertId is required and cannot be null.")); + } + final String apiVersion = "2022-08-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), scope, alertId, apiVersion, accept, context); + } + + /** + * Get the specified alert configuration. + * + * @param scope The scope of the alert configuration. The scope can be any REST resource instance. For example, use + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param alertId The name of the alert configuration to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified alert configuration on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String scope, String alertId) { + return getWithResponseAsync(scope, alertId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the specified alert configuration. + * + * @param scope The scope of the alert configuration. The scope can be any REST resource instance. For example, use + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param alertId The name of the alert configuration to get. + * @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 specified alert configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String scope, String alertId, Context context) { + return getWithResponseAsync(scope, alertId, context).block(); + } + + /** + * Get the specified alert configuration. + * + * @param scope The scope of the alert configuration. The scope can be any REST resource instance. For example, use + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param alertId The name of the alert configuration to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified alert configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AlertConfigurationInner get(String scope, String alertId) { + return getWithResponse(scope, alertId, Context.NONE).getValue(); + } + + /** + * Update an alert configuration. + * + * @param scope The scope of the alert configuration. + * @param alertId The name of the alert configuration to update. + * @param parameters Parameters for the alert configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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> updateWithResponseAsync( + String scope, String alertId, AlertConfigurationInner parameters) { + 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 (alertId == null) { + return Mono.error(new IllegalArgumentException("Parameter alertId is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2022-08-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service.update(this.client.getEndpoint(), scope, alertId, apiVersion, parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update an alert configuration. + * + * @param scope The scope of the alert configuration. + * @param alertId The name of the alert configuration to update. + * @param parameters Parameters for the alert configuration. + * @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> updateWithResponseAsync( + String scope, String alertId, AlertConfigurationInner parameters, 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 (alertId == null) { + return Mono.error(new IllegalArgumentException("Parameter alertId is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2022-08-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), scope, alertId, apiVersion, parameters, accept, context); + } + + /** + * Update an alert configuration. + * + * @param scope The scope of the alert configuration. + * @param alertId The name of the alert configuration to update. + * @param parameters Parameters for the alert configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 updateAsync(String scope, String alertId, AlertConfigurationInner parameters) { + return updateWithResponseAsync(scope, alertId, parameters).flatMap(ignored -> Mono.empty()); + } + + /** + * Update an alert configuration. + * + * @param scope The scope of the alert configuration. + * @param alertId The name of the alert configuration to update. + * @param parameters Parameters for the alert configuration. + * @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 updateWithResponse( + String scope, String alertId, AlertConfigurationInner parameters, Context context) { + return updateWithResponseAsync(scope, alertId, parameters, context).block(); + } + + /** + * Update an alert configuration. + * + * @param scope The scope of the alert configuration. + * @param alertId The name of the alert configuration to update. + * @param parameters Parameters for the alert configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 update(String scope, String alertId, AlertConfigurationInner parameters) { + updateWithResponse(scope, alertId, parameters, Context.NONE); + } + + /** + * Gets alert configurations for a resource scope. + * + * @param scope The scope of the alert configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return alert configurations for a resource scope along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeSinglePageAsync(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 apiVersion = "2022-08-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listForScope(this.client.getEndpoint(), scope, apiVersion, 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())); + } + + /** + * Gets alert configurations for a resource scope. + * + * @param scope The scope of the alert configuration. + * @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 alert configurations for a resource scope along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeSinglePageAsync(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 apiVersion = "2022-08-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listForScope(this.client.getEndpoint(), scope, apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets alert configurations for a resource scope. + * + * @param scope The scope of the alert configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return alert configurations for a resource scope as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForScopeAsync(String scope) { + return new PagedFlux<>( + () -> listForScopeSinglePageAsync(scope), nextLink -> listForScopeNextSinglePageAsync(nextLink)); + } + + /** + * Gets alert configurations for a resource scope. + * + * @param scope The scope of the alert configuration. + * @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 alert configurations for a resource scope as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForScopeAsync(String scope, Context context) { + return new PagedFlux<>( + () -> listForScopeSinglePageAsync(scope, context), + nextLink -> listForScopeNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets alert configurations for a resource scope. + * + * @param scope The scope of the alert configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return alert configurations for a resource scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForScope(String scope) { + return new PagedIterable<>(listForScopeAsync(scope)); + } + + /** + * Gets alert configurations for a resource scope. + * + * @param scope The scope of the alert configuration. + * @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 alert configurations for a resource scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForScope(String scope, Context context) { + return new PagedIterable<>(listForScopeAsync(scope, 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 alert configuration list operation result along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeNextSinglePageAsync(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.listForScopeNext(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 alert configuration list operation result along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeNextSinglePageAsync( + 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 + .listForScopeNext(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/AlertConfigurationsImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertConfigurationsImpl.java new file mode 100644 index 000000000000..0d3ffd4ed1c2 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertConfigurationsImpl.java @@ -0,0 +1,79 @@ +// 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.AlertConfigurationsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AlertConfigurationInner; +import com.azure.resourcemanager.authorization.generated.models.AlertConfiguration; +import com.azure.resourcemanager.authorization.generated.models.AlertConfigurations; + +public final class AlertConfigurationsImpl implements AlertConfigurations { + private static final ClientLogger LOGGER = new ClientLogger(AlertConfigurationsImpl.class); + + private final AlertConfigurationsClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public AlertConfigurationsImpl( + AlertConfigurationsClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String scope, String alertId, Context context) { + Response inner = this.serviceClient().getWithResponse(scope, alertId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AlertConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AlertConfiguration get(String scope, String alertId) { + AlertConfigurationInner inner = this.serviceClient().get(scope, alertId); + if (inner != null) { + return new AlertConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response updateWithResponse( + String scope, String alertId, AlertConfigurationInner parameters, Context context) { + return this.serviceClient().updateWithResponse(scope, alertId, parameters, context); + } + + public void update(String scope, String alertId, AlertConfigurationInner parameters) { + this.serviceClient().update(scope, alertId, parameters); + } + + public PagedIterable listForScope(String scope) { + PagedIterable inner = this.serviceClient().listForScope(scope); + return Utils.mapPage(inner, inner1 -> new AlertConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable listForScope(String scope, Context context) { + PagedIterable inner = this.serviceClient().listForScope(scope, context); + return Utils.mapPage(inner, inner1 -> new AlertConfigurationImpl(inner1, this.manager())); + } + + private AlertConfigurationsClient 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/AlertDefinitionImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertDefinitionImpl.java new file mode 100644 index 000000000000..e98add1e3afb --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertDefinitionImpl.java @@ -0,0 +1,78 @@ +// 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.AlertDefinitionInner; +import com.azure.resourcemanager.authorization.generated.models.AlertDefinition; +import com.azure.resourcemanager.authorization.generated.models.SeverityLevel; + +public final class AlertDefinitionImpl implements AlertDefinition { + private AlertDefinitionInner innerObject; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + AlertDefinitionImpl( + AlertDefinitionInner 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 String scope() { + return this.innerModel().scope(); + } + + public String description() { + return this.innerModel().description(); + } + + public SeverityLevel severityLevel() { + return this.innerModel().severityLevel(); + } + + public String securityImpact() { + return this.innerModel().securityImpact(); + } + + public String mitigationSteps() { + return this.innerModel().mitigationSteps(); + } + + public String howToPrevent() { + return this.innerModel().howToPrevent(); + } + + public Boolean isRemediatable() { + return this.innerModel().isRemediatable(); + } + + public Boolean isConfigurable() { + return this.innerModel().isConfigurable(); + } + + public AlertDefinitionInner 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/AlertDefinitionsClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertDefinitionsClientImpl.java new file mode 100644 index 000000000000..a2a100a7acc6 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertDefinitionsClientImpl.java @@ -0,0 +1,442 @@ +// 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.AlertDefinitionsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AlertDefinitionInner; +import com.azure.resourcemanager.authorization.generated.models.AlertDefinitionListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AlertDefinitionsClient. */ +public final class AlertDefinitionsClientImpl implements AlertDefinitionsClient { + /** The proxy service used to perform REST calls. */ + private final AlertDefinitionsService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of AlertDefinitionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AlertDefinitionsClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy.create(AlertDefinitionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AuthorizationManagementClientAlertDefinitions to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + public interface AlertDefinitionsService { + @Headers({"Content-Type: application/json"}) + @Get("/{scope}/providers/Microsoft.Authorization/roleManagementAlertDefinitions/{alertDefinitionId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam(value = "alertDefinitionId", encoded = true) String alertDefinitionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/{scope}/providers/Microsoft.Authorization/roleManagementAlertDefinitions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForScope( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForScopeNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the specified alert definition. + * + * @param scope The scope of the alert definition. The scope can be any REST resource instance. For example, use + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param alertDefinitionId The name of the alert definition to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified alert definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String scope, String alertDefinitionId) { + 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 (alertDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter alertDefinitionId is required and cannot be null.")); + } + final String apiVersion = "2022-08-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service.get(this.client.getEndpoint(), scope, alertDefinitionId, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the specified alert definition. + * + * @param scope The scope of the alert definition. The scope can be any REST resource instance. For example, use + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param alertDefinitionId The name of the alert definition to get. + * @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 specified alert definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String scope, String alertDefinitionId, 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 (alertDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter alertDefinitionId is required and cannot be null.")); + } + final String apiVersion = "2022-08-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), scope, alertDefinitionId, apiVersion, accept, context); + } + + /** + * Get the specified alert definition. + * + * @param scope The scope of the alert definition. The scope can be any REST resource instance. For example, use + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param alertDefinitionId The name of the alert definition to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified alert definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String scope, String alertDefinitionId) { + return getWithResponseAsync(scope, alertDefinitionId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the specified alert definition. + * + * @param scope The scope of the alert definition. The scope can be any REST resource instance. For example, use + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param alertDefinitionId The name of the alert definition to get. + * @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 specified alert definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String scope, String alertDefinitionId, Context context) { + return getWithResponseAsync(scope, alertDefinitionId, context).block(); + } + + /** + * Get the specified alert definition. + * + * @param scope The scope of the alert definition. The scope can be any REST resource instance. For example, use + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param alertDefinitionId The name of the alert definition to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified alert definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AlertDefinitionInner get(String scope, String alertDefinitionId) { + return getWithResponse(scope, alertDefinitionId, Context.NONE).getValue(); + } + + /** + * Gets alert definitions for a resource scope. + * + * @param scope The scope of the alert 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 alert definitions for a resource scope along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeSinglePageAsync(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 apiVersion = "2022-08-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listForScope(this.client.getEndpoint(), scope, apiVersion, 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())); + } + + /** + * Gets alert definitions for a resource scope. + * + * @param scope The scope of the alert 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 alert definitions for a resource scope along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeSinglePageAsync(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 apiVersion = "2022-08-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listForScope(this.client.getEndpoint(), scope, apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets alert definitions for a resource scope. + * + * @param scope The scope of the alert 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 alert definitions for a resource scope as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForScopeAsync(String scope) { + return new PagedFlux<>( + () -> listForScopeSinglePageAsync(scope), nextLink -> listForScopeNextSinglePageAsync(nextLink)); + } + + /** + * Gets alert definitions for a resource scope. + * + * @param scope The scope of the alert 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 alert definitions for a resource scope as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForScopeAsync(String scope, Context context) { + return new PagedFlux<>( + () -> listForScopeSinglePageAsync(scope, context), + nextLink -> listForScopeNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets alert definitions for a resource scope. + * + * @param scope The scope of the alert 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 alert definitions for a resource scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForScope(String scope) { + return new PagedIterable<>(listForScopeAsync(scope)); + } + + /** + * Gets alert definitions for a resource scope. + * + * @param scope The scope of the alert 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 alert definitions for a resource scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForScope(String scope, Context context) { + return new PagedIterable<>(listForScopeAsync(scope, 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 alert definition list operation result along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeNextSinglePageAsync(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.listForScopeNext(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 alert definition list operation result along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeNextSinglePageAsync( + 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 + .listForScopeNext(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/AlertDefinitionsImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertDefinitionsImpl.java new file mode 100644 index 000000000000..9237f992b53d --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertDefinitionsImpl.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.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.AlertDefinitionsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AlertDefinitionInner; +import com.azure.resourcemanager.authorization.generated.models.AlertDefinition; +import com.azure.resourcemanager.authorization.generated.models.AlertDefinitions; + +public final class AlertDefinitionsImpl implements AlertDefinitions { + private static final ClientLogger LOGGER = new ClientLogger(AlertDefinitionsImpl.class); + + private final AlertDefinitionsClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public AlertDefinitionsImpl( + AlertDefinitionsClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String scope, String alertDefinitionId, Context context) { + Response inner = this.serviceClient().getWithResponse(scope, alertDefinitionId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AlertDefinitionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AlertDefinition get(String scope, String alertDefinitionId) { + AlertDefinitionInner inner = this.serviceClient().get(scope, alertDefinitionId); + if (inner != null) { + return new AlertDefinitionImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listForScope(String scope) { + PagedIterable inner = this.serviceClient().listForScope(scope); + return Utils.mapPage(inner, inner1 -> new AlertDefinitionImpl(inner1, this.manager())); + } + + public PagedIterable listForScope(String scope, Context context) { + PagedIterable inner = this.serviceClient().listForScope(scope, context); + return Utils.mapPage(inner, inner1 -> new AlertDefinitionImpl(inner1, this.manager())); + } + + private AlertDefinitionsClient 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/AlertImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertImpl.java new file mode 100644 index 000000000000..873a0bc0ce35 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertImpl.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.implementation; + +import com.azure.resourcemanager.authorization.generated.fluent.models.AlertConfigurationInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AlertDefinitionInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AlertIncidentInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AlertInner; +import com.azure.resourcemanager.authorization.generated.models.Alert; +import com.azure.resourcemanager.authorization.generated.models.AlertConfiguration; +import com.azure.resourcemanager.authorization.generated.models.AlertDefinition; +import com.azure.resourcemanager.authorization.generated.models.AlertIncident; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class AlertImpl implements Alert { + private AlertInner innerObject; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + AlertImpl( + AlertInner 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 scope() { + return this.innerModel().scope(); + } + + public Boolean isActive() { + return this.innerModel().isActive(); + } + + public Integer incidentCount() { + return this.innerModel().incidentCount(); + } + + public OffsetDateTime lastModifiedDateTime() { + return this.innerModel().lastModifiedDateTime(); + } + + public OffsetDateTime lastScannedDateTime() { + return this.innerModel().lastScannedDateTime(); + } + + public AlertDefinition alertDefinition() { + AlertDefinitionInner inner = this.innerModel().alertDefinition(); + if (inner != null) { + return new AlertDefinitionImpl(inner, this.manager()); + } else { + return null; + } + } + + public List alertIncidents() { + List inner = this.innerModel().alertIncidents(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new AlertIncidentImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public AlertConfiguration alertConfiguration() { + AlertConfigurationInner inner = this.innerModel().alertConfiguration(); + if (inner != null) { + return new AlertConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public AlertInner 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/AlertIncidentImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertIncidentImpl.java new file mode 100644 index 000000000000..b843f0f36808 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertIncidentImpl.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.AlertIncidentInner; +import com.azure.resourcemanager.authorization.generated.models.AlertIncident; +import com.azure.resourcemanager.authorization.generated.models.AlertIncidentProperties; + +public final class AlertIncidentImpl implements AlertIncident { + private AlertIncidentInner innerObject; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + AlertIncidentImpl( + AlertIncidentInner 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 AlertIncidentProperties properties() { + return this.innerModel().properties(); + } + + public AlertIncidentInner 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/AlertIncidentsClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertIncidentsClientImpl.java new file mode 100644 index 000000000000..69471db08dff --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertIncidentsClientImpl.java @@ -0,0 +1,613 @@ +// 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.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.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.AlertIncidentsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AlertIncidentInner; +import com.azure.resourcemanager.authorization.generated.models.AlertIncidentListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AlertIncidentsClient. */ +public final class AlertIncidentsClientImpl implements AlertIncidentsClient { + /** The proxy service used to perform REST calls. */ + private final AlertIncidentsService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of AlertIncidentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AlertIncidentsClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy.create(AlertIncidentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AuthorizationManagementClientAlertIncidents to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + public interface AlertIncidentsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/{scope}/providers/Microsoft.Authorization/roleManagementAlerts/{alertId}/alertIncidents/{alertIncidentId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam(value = "alertId", encoded = true) String alertId, + @PathParam(value = "alertIncidentId", encoded = true) String alertIncidentId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/{scope}/providers/Microsoft.Authorization/roleManagementAlerts/{alertId}/alertIncidents") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForScope( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam(value = "alertId", encoded = true) String alertId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/{scope}/providers/Microsoft.Authorization/roleManagementAlerts/{alertId}/alertIncidents/{alertIncidentId}/remediate") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> remediate( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam(value = "alertId", encoded = true) String alertId, + @PathParam(value = "alertIncidentId", encoded = true) String alertIncidentId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForScopeNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the specified alert incident. + * + * @param scope The scope of the alert incident. The scope can be any REST resource instance. For example, use + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param alertId The name of the alert. + * @param alertIncidentId The name of the alert incident to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified alert incident along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String scope, String alertId, String alertIncidentId) { + 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 (alertId == null) { + return Mono.error(new IllegalArgumentException("Parameter alertId is required and cannot be null.")); + } + if (alertIncidentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter alertIncidentId is required and cannot be null.")); + } + final String apiVersion = "2022-08-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get(this.client.getEndpoint(), scope, alertId, alertIncidentId, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the specified alert incident. + * + * @param scope The scope of the alert incident. The scope can be any REST resource instance. For example, use + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param alertId The name of the alert. + * @param alertIncidentId The name of the alert incident to get. + * @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 specified alert incident along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String scope, String alertId, String alertIncidentId, 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 (alertId == null) { + return Mono.error(new IllegalArgumentException("Parameter alertId is required and cannot be null.")); + } + if (alertIncidentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter alertIncidentId is required and cannot be null.")); + } + final String apiVersion = "2022-08-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), scope, alertId, alertIncidentId, apiVersion, accept, context); + } + + /** + * Get the specified alert incident. + * + * @param scope The scope of the alert incident. The scope can be any REST resource instance. For example, use + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param alertId The name of the alert. + * @param alertIncidentId The name of the alert incident to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified alert incident on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String scope, String alertId, String alertIncidentId) { + return getWithResponseAsync(scope, alertId, alertIncidentId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the specified alert incident. + * + * @param scope The scope of the alert incident. The scope can be any REST resource instance. For example, use + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param alertId The name of the alert. + * @param alertIncidentId The name of the alert incident to get. + * @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 specified alert incident along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String scope, String alertId, String alertIncidentId, Context context) { + return getWithResponseAsync(scope, alertId, alertIncidentId, context).block(); + } + + /** + * Get the specified alert incident. + * + * @param scope The scope of the alert incident. The scope can be any REST resource instance. For example, use + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param alertId The name of the alert. + * @param alertIncidentId The name of the alert incident to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified alert incident. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AlertIncidentInner get(String scope, String alertId, String alertIncidentId) { + return getWithResponse(scope, alertId, alertIncidentId, Context.NONE).getValue(); + } + + /** + * Gets alert incidents for a resource scope. + * + * @param scope The scope of the alert incident. + * @param alertId The name of the alert. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return alert incidents for a resource scope along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeSinglePageAsync(String scope, String alertId) { + 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 (alertId == null) { + return Mono.error(new IllegalArgumentException("Parameter alertId is required and cannot be null.")); + } + final String apiVersion = "2022-08-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listForScope(this.client.getEndpoint(), scope, alertId, apiVersion, 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())); + } + + /** + * Gets alert incidents for a resource scope. + * + * @param scope The scope of the alert incident. + * @param alertId The name of the alert. + * @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 alert incidents for a resource scope along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeSinglePageAsync( + String scope, String alertId, 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 (alertId == null) { + return Mono.error(new IllegalArgumentException("Parameter alertId is required and cannot be null.")); + } + final String apiVersion = "2022-08-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listForScope(this.client.getEndpoint(), scope, alertId, apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets alert incidents for a resource scope. + * + * @param scope The scope of the alert incident. + * @param alertId The name of the alert. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return alert incidents for a resource scope as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForScopeAsync(String scope, String alertId) { + return new PagedFlux<>( + () -> listForScopeSinglePageAsync(scope, alertId), nextLink -> listForScopeNextSinglePageAsync(nextLink)); + } + + /** + * Gets alert incidents for a resource scope. + * + * @param scope The scope of the alert incident. + * @param alertId The name of the alert. + * @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 alert incidents for a resource scope as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForScopeAsync(String scope, String alertId, Context context) { + return new PagedFlux<>( + () -> listForScopeSinglePageAsync(scope, alertId, context), + nextLink -> listForScopeNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets alert incidents for a resource scope. + * + * @param scope The scope of the alert incident. + * @param alertId The name of the alert. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return alert incidents for a resource scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForScope(String scope, String alertId) { + return new PagedIterable<>(listForScopeAsync(scope, alertId)); + } + + /** + * Gets alert incidents for a resource scope. + * + * @param scope The scope of the alert incident. + * @param alertId The name of the alert. + * @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 alert incidents for a resource scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForScope(String scope, String alertId, Context context) { + return new PagedIterable<>(listForScopeAsync(scope, alertId, context)); + } + + /** + * Remediate an alert incident. + * + * @param scope The scope of the alert incident. + * @param alertId The name of the alert. + * @param alertIncidentId The name of the alert incident to remediate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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> remediateWithResponseAsync(String scope, String alertId, String alertIncidentId) { + 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 (alertId == null) { + return Mono.error(new IllegalArgumentException("Parameter alertId is required and cannot be null.")); + } + if (alertIncidentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter alertIncidentId is required and cannot be null.")); + } + final String apiVersion = "2022-08-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .remediate( + this.client.getEndpoint(), scope, alertId, alertIncidentId, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Remediate an alert incident. + * + * @param scope The scope of the alert incident. + * @param alertId The name of the alert. + * @param alertIncidentId The name of the alert incident to remediate. + * @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> remediateWithResponseAsync( + String scope, String alertId, String alertIncidentId, 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 (alertId == null) { + return Mono.error(new IllegalArgumentException("Parameter alertId is required and cannot be null.")); + } + if (alertIncidentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter alertIncidentId is required and cannot be null.")); + } + final String apiVersion = "2022-08-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .remediate(this.client.getEndpoint(), scope, alertId, alertIncidentId, apiVersion, accept, context); + } + + /** + * Remediate an alert incident. + * + * @param scope The scope of the alert incident. + * @param alertId The name of the alert. + * @param alertIncidentId The name of the alert incident to remediate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 remediateAsync(String scope, String alertId, String alertIncidentId) { + return remediateWithResponseAsync(scope, alertId, alertIncidentId).flatMap(ignored -> Mono.empty()); + } + + /** + * Remediate an alert incident. + * + * @param scope The scope of the alert incident. + * @param alertId The name of the alert. + * @param alertIncidentId The name of the alert incident to remediate. + * @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 remediateWithResponse(String scope, String alertId, String alertIncidentId, Context context) { + return remediateWithResponseAsync(scope, alertId, alertIncidentId, context).block(); + } + + /** + * Remediate an alert incident. + * + * @param scope The scope of the alert incident. + * @param alertId The name of the alert. + * @param alertIncidentId The name of the alert incident to remediate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 remediate(String scope, String alertId, String alertIncidentId) { + remediateWithResponse(scope, alertId, alertIncidentId, Context.NONE); + } + + /** + * 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 alert incident list operation result along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeNextSinglePageAsync(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.listForScopeNext(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 alert incident list operation result along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeNextSinglePageAsync(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 + .listForScopeNext(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/AlertIncidentsImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertIncidentsImpl.java new file mode 100644 index 000000000000..c063f1003070 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertIncidentsImpl.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.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.AlertIncidentsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AlertIncidentInner; +import com.azure.resourcemanager.authorization.generated.models.AlertIncident; +import com.azure.resourcemanager.authorization.generated.models.AlertIncidents; + +public final class AlertIncidentsImpl implements AlertIncidents { + private static final ClientLogger LOGGER = new ClientLogger(AlertIncidentsImpl.class); + + private final AlertIncidentsClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public AlertIncidentsImpl( + AlertIncidentsClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String scope, String alertId, String alertIncidentId, Context context) { + Response inner = + this.serviceClient().getWithResponse(scope, alertId, alertIncidentId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AlertIncidentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AlertIncident get(String scope, String alertId, String alertIncidentId) { + AlertIncidentInner inner = this.serviceClient().get(scope, alertId, alertIncidentId); + if (inner != null) { + return new AlertIncidentImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listForScope(String scope, String alertId) { + PagedIterable inner = this.serviceClient().listForScope(scope, alertId); + return Utils.mapPage(inner, inner1 -> new AlertIncidentImpl(inner1, this.manager())); + } + + public PagedIterable listForScope(String scope, String alertId, Context context) { + PagedIterable inner = this.serviceClient().listForScope(scope, alertId, context); + return Utils.mapPage(inner, inner1 -> new AlertIncidentImpl(inner1, this.manager())); + } + + public Response remediateWithResponse(String scope, String alertId, String alertIncidentId, Context context) { + return this.serviceClient().remediateWithResponse(scope, alertId, alertIncidentId, context); + } + + public void remediate(String scope, String alertId, String alertIncidentId) { + this.serviceClient().remediate(scope, alertId, alertIncidentId); + } + + private AlertIncidentsClient 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/AlertOperationResultImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertOperationResultImpl.java new file mode 100644 index 000000000000..68d34bec7c0e --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertOperationResultImpl.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.AlertOperationResultInner; +import com.azure.resourcemanager.authorization.generated.models.AlertOperationResult; +import java.time.OffsetDateTime; + +public final class AlertOperationResultImpl implements AlertOperationResult { + private AlertOperationResultInner innerObject; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + AlertOperationResultImpl( + AlertOperationResultInner innerObject, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String status() { + return this.innerModel().status(); + } + + public String statusDetail() { + return this.innerModel().statusDetail(); + } + + public OffsetDateTime createdDateTime() { + return this.innerModel().createdDateTime(); + } + + public OffsetDateTime lastActionDateTime() { + return this.innerModel().lastActionDateTime(); + } + + public String resourceLocation() { + return this.innerModel().resourceLocation(); + } + + public AlertOperationResultInner 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/AlertOperationsClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertOperationsClientImpl.java new file mode 100644 index 000000000000..7479ea70e4d7 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertOperationsClientImpl.java @@ -0,0 +1,176 @@ +// 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.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.AlertOperationsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AlertOperationResultInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AlertOperationsClient. */ +public final class AlertOperationsClientImpl implements AlertOperationsClient { + /** The proxy service used to perform REST calls. */ + private final AlertOperationsService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of AlertOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AlertOperationsClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy.create(AlertOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AuthorizationManagementClientAlertOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + public interface AlertOperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/{scope}/providers/Microsoft.Authorization/roleManagementAlertOperations/{operationId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam(value = "operationId", encoded = true) String operationId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the specified alert operation. + * + * @param scope The scope of the alert operation. + * @param operationId The id of the alert 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 specified alert operation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String scope, String operationId) { + 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 (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2022-08-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.get(this.client.getEndpoint(), scope, operationId, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the specified alert operation. + * + * @param scope The scope of the alert operation. + * @param operationId The id of the alert operation. + * @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 specified alert operation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String scope, String operationId, 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 (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String apiVersion = "2022-08-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), scope, operationId, apiVersion, accept, context); + } + + /** + * Get the specified alert operation. + * + * @param scope The scope of the alert operation. + * @param operationId The id of the alert 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 specified alert operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String scope, String operationId) { + return getWithResponseAsync(scope, operationId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the specified alert operation. + * + * @param scope The scope of the alert operation. + * @param operationId The id of the alert operation. + * @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 specified alert operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String scope, String operationId, Context context) { + return getWithResponseAsync(scope, operationId, context).block(); + } + + /** + * Get the specified alert operation. + * + * @param scope The scope of the alert operation. + * @param operationId The id of the alert 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 specified alert operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AlertOperationResultInner get(String scope, String operationId) { + return getWithResponse(scope, operationId, Context.NONE).getValue(); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertOperationsImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertOperationsImpl.java new file mode 100644 index 000000000000..e6ff01c0ab12 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertOperationsImpl.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.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.AlertOperationsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AlertOperationResultInner; +import com.azure.resourcemanager.authorization.generated.models.AlertOperationResult; +import com.azure.resourcemanager.authorization.generated.models.AlertOperations; + +public final class AlertOperationsImpl implements AlertOperations { + private static final ClientLogger LOGGER = new ClientLogger(AlertOperationsImpl.class); + + private final AlertOperationsClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public AlertOperationsImpl( + AlertOperationsClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String scope, String operationId, Context context) { + Response inner = this.serviceClient().getWithResponse(scope, operationId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AlertOperationResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AlertOperationResult get(String scope, String operationId) { + AlertOperationResultInner inner = this.serviceClient().get(scope, operationId); + if (inner != null) { + return new AlertOperationResultImpl(inner, this.manager()); + } else { + return null; + } + } + + private AlertOperationsClient 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/AlertPropertiesImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertPropertiesImpl.java new file mode 100644 index 000000000000..e84f7817cfe5 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertPropertiesImpl.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.resourcemanager.authorization.generated.fluent.models.AlertConfigurationInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AlertDefinitionInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AlertIncidentInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AlertPropertiesInner; +import com.azure.resourcemanager.authorization.generated.models.AlertConfiguration; +import com.azure.resourcemanager.authorization.generated.models.AlertDefinition; +import com.azure.resourcemanager.authorization.generated.models.AlertIncident; +import com.azure.resourcemanager.authorization.generated.models.AlertProperties; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class AlertPropertiesImpl implements AlertProperties { + private AlertPropertiesInner innerObject; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + AlertPropertiesImpl( + AlertPropertiesInner innerObject, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String scope() { + return this.innerModel().scope(); + } + + public Boolean isActive() { + return this.innerModel().isActive(); + } + + public Integer incidentCount() { + return this.innerModel().incidentCount(); + } + + public OffsetDateTime lastModifiedDateTime() { + return this.innerModel().lastModifiedDateTime(); + } + + public OffsetDateTime lastScannedDateTime() { + return this.innerModel().lastScannedDateTime(); + } + + public AlertDefinition alertDefinition() { + AlertDefinitionInner inner = this.innerModel().alertDefinition(); + if (inner != null) { + return new AlertDefinitionImpl(inner, this.manager()); + } else { + return null; + } + } + + public List alertIncidents() { + List inner = this.innerModel().alertIncidents(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new AlertIncidentImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public AlertConfiguration alertConfiguration() { + AlertConfigurationInner inner = this.innerModel().alertConfiguration(); + if (inner != null) { + return new AlertConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public AlertPropertiesInner 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/AlertsClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertsClientImpl.java new file mode 100644 index 000000000000..c88d4102ca28 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertsClientImpl.java @@ -0,0 +1,999 @@ +// 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.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.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.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.authorization.generated.fluent.AlertsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AlertInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AlertOperationResultInner; +import com.azure.resourcemanager.authorization.generated.models.AlertListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AlertsClient. */ +public final class AlertsClientImpl implements AlertsClient { + /** The proxy service used to perform REST calls. */ + private final AlertsService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of AlertsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AlertsClientImpl(AuthorizationManagementClientImpl client) { + this.service = RestProxy.create(AlertsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AuthorizationManagementClientAlerts to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + public interface AlertsService { + @Headers({"Content-Type: application/json"}) + @Get("/{scope}/providers/Microsoft.Authorization/roleManagementAlerts/{alertId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam(value = "alertId", encoded = true) String alertId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch("/{scope}/providers/Microsoft.Authorization/roleManagementAlerts/{alertId}") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam(value = "alertId", encoded = true) String alertId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AlertInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/{scope}/providers/Microsoft.Authorization/roleManagementAlerts") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForScope( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/{scope}/providers/Microsoft.Authorization/roleManagementAlerts/{alertId}/refresh") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> refresh( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam(value = "alertId", encoded = true) String alertId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/{scope}/providers/Microsoft.Authorization/roleManagementAlerts/refresh") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> refreshAll( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForScopeNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the specified alert. + * + * @param scope The scope of the alert. The scope can be any REST resource instance. For example, use + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param alertId The name of the alert to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified alert along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String scope, String alertId) { + 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 (alertId == null) { + return Mono.error(new IllegalArgumentException("Parameter alertId is required and cannot be null.")); + } + final String apiVersion = "2022-08-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), scope, alertId, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the specified alert. + * + * @param scope The scope of the alert. The scope can be any REST resource instance. For example, use + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param alertId The name of the alert to get. + * @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 specified alert along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String scope, String alertId, 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 (alertId == null) { + return Mono.error(new IllegalArgumentException("Parameter alertId is required and cannot be null.")); + } + final String apiVersion = "2022-08-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), scope, alertId, apiVersion, accept, context); + } + + /** + * Get the specified alert. + * + * @param scope The scope of the alert. The scope can be any REST resource instance. For example, use + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param alertId The name of the alert to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified alert on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String scope, String alertId) { + return getWithResponseAsync(scope, alertId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the specified alert. + * + * @param scope The scope of the alert. The scope can be any REST resource instance. For example, use + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param alertId The name of the alert to get. + * @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 specified alert along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String scope, String alertId, Context context) { + return getWithResponseAsync(scope, alertId, context).block(); + } + + /** + * Get the specified alert. + * + * @param scope The scope of the alert. The scope can be any REST resource instance. For example, use + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param alertId The name of the alert to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified alert. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AlertInner get(String scope, String alertId) { + return getWithResponse(scope, alertId, Context.NONE).getValue(); + } + + /** + * Update an alert. + * + * @param scope The scope of the alert. + * @param alertId The name of the alert to dismiss. + * @param parameters Parameters for the alert. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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> updateWithResponseAsync(String scope, String alertId, AlertInner parameters) { + 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 (alertId == null) { + return Mono.error(new IllegalArgumentException("Parameter alertId is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2022-08-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service.update(this.client.getEndpoint(), scope, alertId, apiVersion, parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update an alert. + * + * @param scope The scope of the alert. + * @param alertId The name of the alert to dismiss. + * @param parameters Parameters for the alert. + * @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> updateWithResponseAsync( + String scope, String alertId, AlertInner parameters, 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 (alertId == null) { + return Mono.error(new IllegalArgumentException("Parameter alertId is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2022-08-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), scope, alertId, apiVersion, parameters, accept, context); + } + + /** + * Update an alert. + * + * @param scope The scope of the alert. + * @param alertId The name of the alert to dismiss. + * @param parameters Parameters for the alert. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 updateAsync(String scope, String alertId, AlertInner parameters) { + return updateWithResponseAsync(scope, alertId, parameters).flatMap(ignored -> Mono.empty()); + } + + /** + * Update an alert. + * + * @param scope The scope of the alert. + * @param alertId The name of the alert to dismiss. + * @param parameters Parameters for the alert. + * @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 updateWithResponse(String scope, String alertId, AlertInner parameters, Context context) { + return updateWithResponseAsync(scope, alertId, parameters, context).block(); + } + + /** + * Update an alert. + * + * @param scope The scope of the alert. + * @param alertId The name of the alert to dismiss. + * @param parameters Parameters for the alert. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 update(String scope, String alertId, AlertInner parameters) { + updateWithResponse(scope, alertId, parameters, Context.NONE); + } + + /** + * Gets alerts for a resource scope. + * + * @param scope The scope of the alert. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return alerts for a resource scope along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeSinglePageAsync(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 apiVersion = "2022-08-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listForScope(this.client.getEndpoint(), scope, apiVersion, 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())); + } + + /** + * Gets alerts for a resource scope. + * + * @param scope The scope of the alert. + * @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 alerts for a resource scope along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeSinglePageAsync(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 apiVersion = "2022-08-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listForScope(this.client.getEndpoint(), scope, apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets alerts for a resource scope. + * + * @param scope The scope of the alert. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return alerts for a resource scope as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForScopeAsync(String scope) { + return new PagedFlux<>( + () -> listForScopeSinglePageAsync(scope), nextLink -> listForScopeNextSinglePageAsync(nextLink)); + } + + /** + * Gets alerts for a resource scope. + * + * @param scope The scope of the alert. + * @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 alerts for a resource scope as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForScopeAsync(String scope, Context context) { + return new PagedFlux<>( + () -> listForScopeSinglePageAsync(scope, context), + nextLink -> listForScopeNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets alerts for a resource scope. + * + * @param scope The scope of the alert. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return alerts for a resource scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForScope(String scope) { + return new PagedIterable<>(listForScopeAsync(scope)); + } + + /** + * Gets alerts for a resource scope. + * + * @param scope The scope of the alert. + * @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 alerts for a resource scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForScope(String scope, Context context) { + return new PagedIterable<>(listForScopeAsync(scope, context)); + } + + /** + * Refresh an alert. + * + * @param scope The scope of the alert. + * @param alertId The name of the alert to refresh. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return alert operation result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> refreshWithResponseAsync(String scope, String alertId) { + 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 (alertId == null) { + return Mono.error(new IllegalArgumentException("Parameter alertId is required and cannot be null.")); + } + final String apiVersion = "2022-08-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.refresh(this.client.getEndpoint(), scope, alertId, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Refresh an alert. + * + * @param scope The scope of the alert. + * @param alertId The name of the alert to refresh. + * @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 alert operation result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> refreshWithResponseAsync(String scope, String alertId, 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 (alertId == null) { + return Mono.error(new IllegalArgumentException("Parameter alertId is required and cannot be null.")); + } + final String apiVersion = "2022-08-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.refresh(this.client.getEndpoint(), scope, alertId, apiVersion, accept, context); + } + + /** + * Refresh an alert. + * + * @param scope The scope of the alert. + * @param alertId The name of the alert to refresh. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 PollerFlux} for polling of alert operation result. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AlertOperationResultInner> beginRefreshAsync( + String scope, String alertId) { + Mono>> mono = refreshWithResponseAsync(scope, alertId); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AlertOperationResultInner.class, + AlertOperationResultInner.class, + this.client.getContext()); + } + + /** + * Refresh an alert. + * + * @param scope The scope of the alert. + * @param alertId The name of the alert to refresh. + * @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 PollerFlux} for polling of alert operation result. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AlertOperationResultInner> beginRefreshAsync( + String scope, String alertId, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = refreshWithResponseAsync(scope, alertId, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AlertOperationResultInner.class, + AlertOperationResultInner.class, + context); + } + + /** + * Refresh an alert. + * + * @param scope The scope of the alert. + * @param alertId The name of the alert to refresh. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 SyncPoller} for polling of alert operation result. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AlertOperationResultInner> beginRefresh( + String scope, String alertId) { + return this.beginRefreshAsync(scope, alertId).getSyncPoller(); + } + + /** + * Refresh an alert. + * + * @param scope The scope of the alert. + * @param alertId The name of the alert to refresh. + * @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 SyncPoller} for polling of alert operation result. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AlertOperationResultInner> beginRefresh( + String scope, String alertId, Context context) { + return this.beginRefreshAsync(scope, alertId, context).getSyncPoller(); + } + + /** + * Refresh an alert. + * + * @param scope The scope of the alert. + * @param alertId The name of the alert to refresh. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return alert operation result on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono refreshAsync(String scope, String alertId) { + return beginRefreshAsync(scope, alertId).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Refresh an alert. + * + * @param scope The scope of the alert. + * @param alertId The name of the alert to refresh. + * @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 alert operation result on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono refreshAsync(String scope, String alertId, Context context) { + return beginRefreshAsync(scope, alertId, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Refresh an alert. + * + * @param scope The scope of the alert. + * @param alertId The name of the alert to refresh. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return alert operation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AlertOperationResultInner refresh(String scope, String alertId) { + return refreshAsync(scope, alertId).block(); + } + + /** + * Refresh an alert. + * + * @param scope The scope of the alert. + * @param alertId The name of the alert to refresh. + * @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 alert operation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AlertOperationResultInner refresh(String scope, String alertId, Context context) { + return refreshAsync(scope, alertId, context).block(); + } + + /** + * Refresh all alerts for a resource scope. + * + * @param scope The scope of the alert. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return alert operation result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> refreshAllWithResponseAsync(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 apiVersion = "2022-08-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.refreshAll(this.client.getEndpoint(), scope, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Refresh all alerts for a resource scope. + * + * @param scope The scope of the alert. + * @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 alert operation result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> refreshAllWithResponseAsync(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 apiVersion = "2022-08-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.refreshAll(this.client.getEndpoint(), scope, apiVersion, accept, context); + } + + /** + * Refresh all alerts for a resource scope. + * + * @param scope The scope of the alert. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 PollerFlux} for polling of alert operation result. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AlertOperationResultInner> beginRefreshAllAsync( + String scope) { + Mono>> mono = refreshAllWithResponseAsync(scope); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AlertOperationResultInner.class, + AlertOperationResultInner.class, + this.client.getContext()); + } + + /** + * Refresh all alerts for a resource scope. + * + * @param scope The scope of the alert. + * @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 PollerFlux} for polling of alert operation result. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AlertOperationResultInner> beginRefreshAllAsync( + String scope, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = refreshAllWithResponseAsync(scope, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AlertOperationResultInner.class, + AlertOperationResultInner.class, + context); + } + + /** + * Refresh all alerts for a resource scope. + * + * @param scope The scope of the alert. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 SyncPoller} for polling of alert operation result. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AlertOperationResultInner> beginRefreshAll(String scope) { + return this.beginRefreshAllAsync(scope).getSyncPoller(); + } + + /** + * Refresh all alerts for a resource scope. + * + * @param scope The scope of the alert. + * @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 SyncPoller} for polling of alert operation result. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AlertOperationResultInner> beginRefreshAll( + String scope, Context context) { + return this.beginRefreshAllAsync(scope, context).getSyncPoller(); + } + + /** + * Refresh all alerts for a resource scope. + * + * @param scope The scope of the alert. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return alert operation result on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono refreshAllAsync(String scope) { + return beginRefreshAllAsync(scope).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Refresh all alerts for a resource scope. + * + * @param scope The scope of the alert. + * @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 alert operation result on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono refreshAllAsync(String scope, Context context) { + return beginRefreshAllAsync(scope, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Refresh all alerts for a resource scope. + * + * @param scope The scope of the alert. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return alert operation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AlertOperationResultInner refreshAll(String scope) { + return refreshAllAsync(scope).block(); + } + + /** + * Refresh all alerts for a resource scope. + * + * @param scope The scope of the alert. + * @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 alert operation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AlertOperationResultInner refreshAll(String scope, Context context) { + return refreshAllAsync(scope, 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 alert list operation result along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeNextSinglePageAsync(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.listForScopeNext(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 alert list operation result along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeNextSinglePageAsync(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 + .listForScopeNext(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/AlertsImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertsImpl.java new file mode 100644 index 000000000000..49281d759c95 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AlertsImpl.java @@ -0,0 +1,116 @@ +// 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.AlertsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.AlertInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.AlertOperationResultInner; +import com.azure.resourcemanager.authorization.generated.models.Alert; +import com.azure.resourcemanager.authorization.generated.models.AlertOperationResult; +import com.azure.resourcemanager.authorization.generated.models.Alerts; + +public final class AlertsImpl implements Alerts { + private static final ClientLogger LOGGER = new ClientLogger(AlertsImpl.class); + + private final AlertsClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public AlertsImpl( + AlertsClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String scope, String alertId, Context context) { + Response inner = this.serviceClient().getWithResponse(scope, alertId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AlertImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Alert get(String scope, String alertId) { + AlertInner inner = this.serviceClient().get(scope, alertId); + if (inner != null) { + return new AlertImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response updateWithResponse(String scope, String alertId, AlertInner parameters, Context context) { + return this.serviceClient().updateWithResponse(scope, alertId, parameters, context); + } + + public void update(String scope, String alertId, AlertInner parameters) { + this.serviceClient().update(scope, alertId, parameters); + } + + public PagedIterable listForScope(String scope) { + PagedIterable inner = this.serviceClient().listForScope(scope); + return Utils.mapPage(inner, inner1 -> new AlertImpl(inner1, this.manager())); + } + + public PagedIterable listForScope(String scope, Context context) { + PagedIterable inner = this.serviceClient().listForScope(scope, context); + return Utils.mapPage(inner, inner1 -> new AlertImpl(inner1, this.manager())); + } + + public AlertOperationResult refresh(String scope, String alertId) { + AlertOperationResultInner inner = this.serviceClient().refresh(scope, alertId); + if (inner != null) { + return new AlertOperationResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public AlertOperationResult refresh(String scope, String alertId, Context context) { + AlertOperationResultInner inner = this.serviceClient().refresh(scope, alertId, context); + if (inner != null) { + return new AlertOperationResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public AlertOperationResult refreshAll(String scope) { + AlertOperationResultInner inner = this.serviceClient().refreshAll(scope); + if (inner != null) { + return new AlertOperationResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public AlertOperationResult refreshAll(String scope, Context context) { + AlertOperationResultInner inner = this.serviceClient().refreshAll(scope, context); + if (inner != null) { + return new AlertOperationResultImpl(inner, this.manager()); + } else { + return null; + } + } + + private AlertsClient 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/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 000000000000..c6ca7e092781 --- /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 000000000000..2a303c37ef79 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/AuthorizationManagementClientImpl.java @@ -0,0 +1,923 @@ +// 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.AlertConfigurationsClient; +import com.azure.resourcemanager.authorization.generated.fluent.AlertDefinitionsClient; +import com.azure.resourcemanager.authorization.generated.fluent.AlertIncidentsClient; +import com.azure.resourcemanager.authorization.generated.fluent.AlertOperationsClient; +import com.azure.resourcemanager.authorization.generated.fluent.AlertsClient; +import com.azure.resourcemanager.authorization.generated.fluent.AuthorizationManagementClient; +import com.azure.resourcemanager.authorization.generated.fluent.ClassicAdministratorsClient; +import com.azure.resourcemanager.authorization.generated.fluent.DenyAssignmentsClient; +import com.azure.resourcemanager.authorization.generated.fluent.EligibleChildResourcesClient; +import com.azure.resourcemanager.authorization.generated.fluent.GlobalAdministratorsClient; +import com.azure.resourcemanager.authorization.generated.fluent.OperationsClient; +import com.azure.resourcemanager.authorization.generated.fluent.PermissionsClient; +import com.azure.resourcemanager.authorization.generated.fluent.ProviderOperationsMetadatasClient; +import com.azure.resourcemanager.authorization.generated.fluent.RoleAssignmentScheduleInstancesClient; +import com.azure.resourcemanager.authorization.generated.fluent.RoleAssignmentScheduleRequestsClient; +import com.azure.resourcemanager.authorization.generated.fluent.RoleAssignmentSchedulesClient; +import com.azure.resourcemanager.authorization.generated.fluent.RoleAssignmentsClient; +import com.azure.resourcemanager.authorization.generated.fluent.RoleDefinitionsClient; +import com.azure.resourcemanager.authorization.generated.fluent.RoleEligibilityScheduleInstancesClient; +import com.azure.resourcemanager.authorization.generated.fluent.RoleEligibilityScheduleRequestsClient; +import com.azure.resourcemanager.authorization.generated.fluent.RoleEligibilitySchedulesClient; +import com.azure.resourcemanager.authorization.generated.fluent.RoleManagementPoliciesClient; +import com.azure.resourcemanager.authorization.generated.fluent.RoleManagementPolicyAssignmentsClient; +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; + } + + /** 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 ClassicAdministratorsClient object to access its operations. */ + private final ClassicAdministratorsClient classicAdministrators; + + /** + * Gets the ClassicAdministratorsClient object to access its operations. + * + * @return the ClassicAdministratorsClient object. + */ + public ClassicAdministratorsClient getClassicAdministrators() { + return this.classicAdministrators; + } + + /** The GlobalAdministratorsClient object to access its operations. */ + private final GlobalAdministratorsClient globalAdministrators; + + /** + * Gets the GlobalAdministratorsClient object to access its operations. + * + * @return the GlobalAdministratorsClient object. + */ + public GlobalAdministratorsClient getGlobalAdministrators() { + return this.globalAdministrators; + } + + /** The DenyAssignmentsClient object to access its operations. */ + private final DenyAssignmentsClient denyAssignments; + + /** + * Gets the DenyAssignmentsClient object to access its operations. + * + * @return the DenyAssignmentsClient object. + */ + public DenyAssignmentsClient getDenyAssignments() { + return this.denyAssignments; + } + + /** The ProviderOperationsMetadatasClient object to access its operations. */ + private final ProviderOperationsMetadatasClient providerOperationsMetadatas; + + /** + * Gets the ProviderOperationsMetadatasClient object to access its operations. + * + * @return the ProviderOperationsMetadatasClient object. + */ + public ProviderOperationsMetadatasClient getProviderOperationsMetadatas() { + return this.providerOperationsMetadatas; + } + + /** The RoleAssignmentsClient object to access its operations. */ + private final RoleAssignmentsClient roleAssignments; + + /** + * Gets the RoleAssignmentsClient object to access its operations. + * + * @return the RoleAssignmentsClient object. + */ + public RoleAssignmentsClient getRoleAssignments() { + return this.roleAssignments; + } + + /** The PermissionsClient object to access its operations. */ + private final PermissionsClient permissions; + + /** + * Gets the PermissionsClient object to access its operations. + * + * @return the PermissionsClient object. + */ + public PermissionsClient getPermissions() { + return this.permissions; + } + + /** The RoleDefinitionsClient object to access its operations. */ + private final RoleDefinitionsClient roleDefinitions; + + /** + * Gets the RoleDefinitionsClient object to access its operations. + * + * @return the RoleDefinitionsClient object. + */ + public RoleDefinitionsClient getRoleDefinitions() { + return this.roleDefinitions; + } + + /** 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; + } + + /** The EligibleChildResourcesClient object to access its operations. */ + private final EligibleChildResourcesClient eligibleChildResources; + + /** + * Gets the EligibleChildResourcesClient object to access its operations. + * + * @return the EligibleChildResourcesClient object. + */ + public EligibleChildResourcesClient getEligibleChildResources() { + return this.eligibleChildResources; + } + + /** The RoleAssignmentSchedulesClient object to access its operations. */ + private final RoleAssignmentSchedulesClient roleAssignmentSchedules; + + /** + * Gets the RoleAssignmentSchedulesClient object to access its operations. + * + * @return the RoleAssignmentSchedulesClient object. + */ + public RoleAssignmentSchedulesClient getRoleAssignmentSchedules() { + return this.roleAssignmentSchedules; + } + + /** The RoleAssignmentScheduleInstancesClient object to access its operations. */ + private final RoleAssignmentScheduleInstancesClient roleAssignmentScheduleInstances; + + /** + * Gets the RoleAssignmentScheduleInstancesClient object to access its operations. + * + * @return the RoleAssignmentScheduleInstancesClient object. + */ + public RoleAssignmentScheduleInstancesClient getRoleAssignmentScheduleInstances() { + return this.roleAssignmentScheduleInstances; + } + + /** The RoleAssignmentScheduleRequestsClient object to access its operations. */ + private final RoleAssignmentScheduleRequestsClient roleAssignmentScheduleRequests; + + /** + * Gets the RoleAssignmentScheduleRequestsClient object to access its operations. + * + * @return the RoleAssignmentScheduleRequestsClient object. + */ + public RoleAssignmentScheduleRequestsClient getRoleAssignmentScheduleRequests() { + return this.roleAssignmentScheduleRequests; + } + + /** The RoleEligibilitySchedulesClient object to access its operations. */ + private final RoleEligibilitySchedulesClient roleEligibilitySchedules; + + /** + * Gets the RoleEligibilitySchedulesClient object to access its operations. + * + * @return the RoleEligibilitySchedulesClient object. + */ + public RoleEligibilitySchedulesClient getRoleEligibilitySchedules() { + return this.roleEligibilitySchedules; + } + + /** The RoleEligibilityScheduleInstancesClient object to access its operations. */ + private final RoleEligibilityScheduleInstancesClient roleEligibilityScheduleInstances; + + /** + * Gets the RoleEligibilityScheduleInstancesClient object to access its operations. + * + * @return the RoleEligibilityScheduleInstancesClient object. + */ + public RoleEligibilityScheduleInstancesClient getRoleEligibilityScheduleInstances() { + return this.roleEligibilityScheduleInstances; + } + + /** The RoleEligibilityScheduleRequestsClient object to access its operations. */ + private final RoleEligibilityScheduleRequestsClient roleEligibilityScheduleRequests; + + /** + * Gets the RoleEligibilityScheduleRequestsClient object to access its operations. + * + * @return the RoleEligibilityScheduleRequestsClient object. + */ + public RoleEligibilityScheduleRequestsClient getRoleEligibilityScheduleRequests() { + return this.roleEligibilityScheduleRequests; + } + + /** The RoleManagementPoliciesClient object to access its operations. */ + private final RoleManagementPoliciesClient roleManagementPolicies; + + /** + * Gets the RoleManagementPoliciesClient object to access its operations. + * + * @return the RoleManagementPoliciesClient object. + */ + public RoleManagementPoliciesClient getRoleManagementPolicies() { + return this.roleManagementPolicies; + } + + /** The RoleManagementPolicyAssignmentsClient object to access its operations. */ + private final RoleManagementPolicyAssignmentsClient roleManagementPolicyAssignments; + + /** + * Gets the RoleManagementPolicyAssignmentsClient object to access its operations. + * + * @return the RoleManagementPolicyAssignmentsClient object. + */ + public RoleManagementPolicyAssignmentsClient getRoleManagementPolicyAssignments() { + return this.roleManagementPolicyAssignments; + } + + /** The AlertsClient object to access its operations. */ + private final AlertsClient alerts; + + /** + * Gets the AlertsClient object to access its operations. + * + * @return the AlertsClient object. + */ + public AlertsClient getAlerts() { + return this.alerts; + } + + /** The AlertConfigurationsClient object to access its operations. */ + private final AlertConfigurationsClient alertConfigurations; + + /** + * Gets the AlertConfigurationsClient object to access its operations. + * + * @return the AlertConfigurationsClient object. + */ + public AlertConfigurationsClient getAlertConfigurations() { + return this.alertConfigurations; + } + + /** The AlertDefinitionsClient object to access its operations. */ + private final AlertDefinitionsClient alertDefinitions; + + /** + * Gets the AlertDefinitionsClient object to access its operations. + * + * @return the AlertDefinitionsClient object. + */ + public AlertDefinitionsClient getAlertDefinitions() { + return this.alertDefinitions; + } + + /** The AlertIncidentsClient object to access its operations. */ + private final AlertIncidentsClient alertIncidents; + + /** + * Gets the AlertIncidentsClient object to access its operations. + * + * @return the AlertIncidentsClient object. + */ + public AlertIncidentsClient getAlertIncidents() { + return this.alertIncidents; + } + + /** The AlertOperationsClient object to access its operations. */ + private final AlertOperationsClient alertOperations; + + /** + * Gets the AlertOperationsClient object to access its operations. + * + * @return the AlertOperationsClient object. + */ + public AlertOperationsClient getAlertOperations() { + return this.alertOperations; + } + + /** + * 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.classicAdministrators = new ClassicAdministratorsClientImpl(this); + this.globalAdministrators = new GlobalAdministratorsClientImpl(this); + this.denyAssignments = new DenyAssignmentsClientImpl(this); + this.providerOperationsMetadatas = new ProviderOperationsMetadatasClientImpl(this); + this.roleAssignments = new RoleAssignmentsClientImpl(this); + this.permissions = new PermissionsClientImpl(this); + this.roleDefinitions = new RoleDefinitionsClientImpl(this); + 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); + this.eligibleChildResources = new EligibleChildResourcesClientImpl(this); + this.roleAssignmentSchedules = new RoleAssignmentSchedulesClientImpl(this); + this.roleAssignmentScheduleInstances = new RoleAssignmentScheduleInstancesClientImpl(this); + this.roleAssignmentScheduleRequests = new RoleAssignmentScheduleRequestsClientImpl(this); + this.roleEligibilitySchedules = new RoleEligibilitySchedulesClientImpl(this); + this.roleEligibilityScheduleInstances = new RoleEligibilityScheduleInstancesClientImpl(this); + this.roleEligibilityScheduleRequests = new RoleEligibilityScheduleRequestsClientImpl(this); + this.roleManagementPolicies = new RoleManagementPoliciesClientImpl(this); + this.roleManagementPolicyAssignments = new RoleManagementPolicyAssignmentsClientImpl(this); + this.alerts = new AlertsClientImpl(this); + this.alertConfigurations = new AlertConfigurationsClientImpl(this); + this.alertDefinitions = new AlertDefinitionsClientImpl(this); + this.alertIncidents = new AlertIncidentsClientImpl(this); + this.alertOperations = new AlertOperationsClientImpl(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/ClassicAdministratorImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ClassicAdministratorImpl.java new file mode 100644 index 000000000000..f71f3b0c47dd --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ClassicAdministratorImpl.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.resourcemanager.authorization.generated.fluent.models.ClassicAdministratorInner; +import com.azure.resourcemanager.authorization.generated.models.ClassicAdministrator; + +public final class ClassicAdministratorImpl implements ClassicAdministrator { + private ClassicAdministratorInner innerObject; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + ClassicAdministratorImpl( + ClassicAdministratorInner 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 emailAddress() { + return this.innerModel().emailAddress(); + } + + public String role() { + return this.innerModel().role(); + } + + public ClassicAdministratorInner 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/ClassicAdministratorsClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ClassicAdministratorsClientImpl.java new file mode 100644 index 000000000000..a3f0960bec72 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ClassicAdministratorsClientImpl.java @@ -0,0 +1,294 @@ +// 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.ClassicAdministratorsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.ClassicAdministratorInner; +import com.azure.resourcemanager.authorization.generated.models.ClassicAdministratorListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ClassicAdministratorsClient. */ +public final class ClassicAdministratorsClientImpl implements ClassicAdministratorsClient { + /** The proxy service used to perform REST calls. */ + private final ClassicAdministratorsService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of ClassicAdministratorsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ClassicAdministratorsClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy + .create(ClassicAdministratorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AuthorizationManagementClientClassicAdministrators to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + public interface ClassicAdministratorsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/classicAdministrators") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @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); + } + + /** + * Gets service administrator, account administrator, and co-administrators 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 service administrator, account administrator, and co-administrators for the subscription 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2015-07-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), 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())); + } + + /** + * Gets service administrator, account administrator, and co-administrators 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 service administrator, account administrator, and co-administrators for the subscription 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.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2015-07-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets service administrator, account administrator, and co-administrators 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 service administrator, account administrator, and co-administrators for the subscription as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets service administrator, account administrator, and co-administrators 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 service administrator, account administrator, and co-administrators for the subscription as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets service administrator, account administrator, and co-administrators 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 service administrator, account administrator, and co-administrators for the subscription as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets service administrator, account administrator, and co-administrators 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 service administrator, account administrator, and co-administrators for the subscription 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 classicAdministrator list result information 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 classicAdministrator list result information 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/ClassicAdministratorsImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ClassicAdministratorsImpl.java new file mode 100644 index 000000000000..5684da171b1c --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ClassicAdministratorsImpl.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.ClassicAdministratorsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.ClassicAdministratorInner; +import com.azure.resourcemanager.authorization.generated.models.ClassicAdministrator; +import com.azure.resourcemanager.authorization.generated.models.ClassicAdministrators; + +public final class ClassicAdministratorsImpl implements ClassicAdministrators { + private static final ClientLogger LOGGER = new ClientLogger(ClassicAdministratorsImpl.class); + + private final ClassicAdministratorsClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public ClassicAdministratorsImpl( + ClassicAdministratorsClient 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 ClassicAdministratorImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ClassicAdministratorImpl(inner1, this.manager())); + } + + private ClassicAdministratorsClient 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/DenyAssignmentImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/DenyAssignmentImpl.java new file mode 100644 index 000000000000..56cedfc30843 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/DenyAssignmentImpl.java @@ -0,0 +1,117 @@ +// 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.DenyAssignmentInner; +import com.azure.resourcemanager.authorization.generated.models.DenyAssignment; +import com.azure.resourcemanager.authorization.generated.models.DenyAssignmentPermission; +import com.azure.resourcemanager.authorization.generated.models.Principal; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class DenyAssignmentImpl implements DenyAssignment { + private DenyAssignmentInner innerObject; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + DenyAssignmentImpl( + DenyAssignmentInner 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 denyAssignmentName() { + return this.innerModel().denyAssignmentName(); + } + + public String description() { + return this.innerModel().description(); + } + + public List permissions() { + List inner = this.innerModel().permissions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String scope() { + return this.innerModel().scope(); + } + + public Boolean doNotApplyToChildScopes() { + return this.innerModel().doNotApplyToChildScopes(); + } + + public List principals() { + List inner = this.innerModel().principals(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List excludePrincipals() { + List inner = this.innerModel().excludePrincipals(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Boolean isSystemProtected() { + return this.innerModel().isSystemProtected(); + } + + public String condition() { + return this.innerModel().condition(); + } + + public String conditionVersion() { + return this.innerModel().conditionVersion(); + } + + public OffsetDateTime createdOn() { + return this.innerModel().createdOn(); + } + + public OffsetDateTime updatedOn() { + return this.innerModel().updatedOn(); + } + + public String createdBy() { + return this.innerModel().createdBy(); + } + + public String updatedBy() { + return this.innerModel().updatedBy(); + } + + public DenyAssignmentInner 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/DenyAssignmentsClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/DenyAssignmentsClientImpl.java new file mode 100644 index 000000000000..5112fc98ce22 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/DenyAssignmentsClientImpl.java @@ -0,0 +1,1696 @@ +// 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.DenyAssignmentsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.DenyAssignmentInner; +import com.azure.resourcemanager.authorization.generated.models.DenyAssignmentListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DenyAssignmentsClient. */ +public final class DenyAssignmentsClientImpl implements DenyAssignmentsClient { + /** The proxy service used to perform REST calls. */ + private final DenyAssignmentsService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of DenyAssignmentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DenyAssignmentsClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy.create(DenyAssignmentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AuthorizationManagementClientDenyAssignments to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + public interface DenyAssignmentsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/denyAssignments") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForResource( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam(value = "resourceProviderNamespace", encoded = true) String resourceProviderNamespace, + @PathParam(value = "parentResourcePath", encoded = true) String parentResourcePath, + @PathParam(value = "resourceType", encoded = true) String resourceType, + @PathParam("resourceName") String resourceName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/denyAssignments") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/denyAssignments") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/{scope}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam("denyAssignmentId") String denyAssignmentId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/{denyAssignmentId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getById( + @HostParam("$host") String endpoint, + @PathParam(value = "denyAssignmentId", encoded = true) String denyAssignmentId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/{scope}/providers/Microsoft.Authorization/denyAssignments") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForScope( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForResourceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @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); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForScopeNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets deny assignments for a resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get deny assignments for. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or + * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified + * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the + * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and + * below the scope for the specified principal. This filter is different from the principalId filter as it + * returns not only those deny assignments that contain the specified principal is the Principals list but also + * those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when + * gdprExportPrincipalId filter is used, only the deny assignment name and description properties 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 deny assignments for a resource along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForResourceSinglePageAsync( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceProviderNamespace == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter resourceProviderNamespace is required and cannot be null.")); + } + if (parentResourcePath == null) { + return Mono + .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2022-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listForResource( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + 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())); + } + + /** + * Gets deny assignments for a resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get deny assignments for. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or + * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified + * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the + * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and + * below the scope for the specified principal. This filter is different from the principalId filter as it + * returns not only those deny assignments that contain the specified principal is the Principals list but also + * those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when + * gdprExportPrincipalId filter is used, only the deny assignment name and description properties 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 deny assignments for a resource along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForResourceSinglePageAsync( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceProviderNamespace == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter resourceProviderNamespace is required and cannot be null.")); + } + if (parentResourcePath == null) { + return Mono + .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2022-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listForResource( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets deny assignments for a resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get deny assignments for. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or + * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified + * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the + * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and + * below the scope for the specified principal. This filter is different from the principalId filter as it + * returns not only those deny assignments that contain the specified principal is the Principals list but also + * those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when + * gdprExportPrincipalId filter is used, only the deny assignment name and description properties 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 deny assignments for a resource as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForResourceAsync( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String filter) { + return new PagedFlux<>( + () -> + listForResourceSinglePageAsync( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + filter), + nextLink -> listForResourceNextSinglePageAsync(nextLink)); + } + + /** + * Gets deny assignments for a resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get deny assignments 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 deny assignments for a resource as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForResourceAsync( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName) { + final String filter = null; + return new PagedFlux<>( + () -> + listForResourceSinglePageAsync( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + filter), + nextLink -> listForResourceNextSinglePageAsync(nextLink)); + } + + /** + * Gets deny assignments for a resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get deny assignments for. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or + * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified + * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the + * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and + * below the scope for the specified principal. This filter is different from the principalId filter as it + * returns not only those deny assignments that contain the specified principal is the Principals list but also + * those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when + * gdprExportPrincipalId filter is used, only the deny assignment name and description properties 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 deny assignments for a resource as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForResourceAsync( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String filter, + Context context) { + return new PagedFlux<>( + () -> + listForResourceSinglePageAsync( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + filter, + context), + nextLink -> listForResourceNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets deny assignments for a resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get deny assignments 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 deny assignments for a resource as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForResource( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName) { + final String filter = null; + return new PagedIterable<>( + listForResourceAsync( + resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter)); + } + + /** + * Gets deny assignments for a resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get deny assignments for. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or + * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified + * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the + * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and + * below the scope for the specified principal. This filter is different from the principalId filter as it + * returns not only those deny assignments that contain the specified principal is the Principals list but also + * those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when + * gdprExportPrincipalId filter is used, only the deny assignment name and description properties 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 deny assignments for a resource as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForResource( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String filter, + Context context) { + return new PagedIterable<>( + listForResourceAsync( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + filter, + context)); + } + + /** + * Gets deny assignments for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or + * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified + * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the + * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and + * below the scope for the specified principal. This filter is different from the principalId filter as it + * returns not only those deny assignments that contain the specified principal is the Principals list but also + * those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when + * gdprExportPrincipalId filter is used, only the deny assignment name and description properties 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 deny assignments for a resource group along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2022-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + 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())); + } + + /** + * Gets deny assignments for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or + * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified + * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the + * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and + * below the scope for the specified principal. This filter is different from the principalId filter as it + * returns not only those deny assignments that contain the specified principal is the Principals list but also + * those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when + * gdprExportPrincipalId filter is used, only the deny assignment name and description properties 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 deny assignments for a resource group along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2022-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets deny assignments for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or + * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified + * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the + * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and + * below the scope for the specified principal. This filter is different from the principalId filter as it + * returns not only those deny assignments that contain the specified principal is the Principals list but also + * those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when + * gdprExportPrincipalId filter is used, only the deny assignment name and description properties 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 deny assignments for a resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter), + nextLink -> listForResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets deny assignments for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deny assignments for a resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final String filter = null; + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter), + nextLink -> listForResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets deny assignments for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or + * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified + * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the + * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and + * below the scope for the specified principal. This filter is different from the principalId filter as it + * returns not only those deny assignments that contain the specified principal is the Principals list but also + * those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when + * gdprExportPrincipalId filter is used, only the deny assignment name and description properties 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 deny assignments for a resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, String filter, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, context), + nextLink -> listForResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets deny assignments for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deny assignments for a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final String filter = null; + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter)); + } + + /** + * Gets deny assignments for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or + * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified + * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the + * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and + * below the scope for the specified principal. This filter is different from the principalId filter as it + * returns not only those deny assignments that contain the specified principal is the Principals list but also + * those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when + * gdprExportPrincipalId filter is used, only the deny assignment name and description properties 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 deny assignments for a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, String filter, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, context)); + } + + /** + * Gets all deny assignments for the subscription. + * + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or + * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified + * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the + * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and + * below the scope for the specified principal. This filter is different from the principalId filter as it + * returns not only those deny assignments that contain the specified principal is the Principals list but also + * those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when + * gdprExportPrincipalId filter is used, only the deny assignment name and description properties 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 all deny assignments for the subscription 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 apiVersion = "2022-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + 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())); + } + + /** + * Gets all deny assignments for the subscription. + * + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or + * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified + * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the + * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and + * below the scope for the specified principal. This filter is different from the principalId filter as it + * returns not only those deny assignments that contain the specified principal is the Principals list but also + * those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when + * gdprExportPrincipalId filter is used, only the deny assignment name and description properties 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 all deny assignments for the subscription 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 apiVersion = "2022-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, filter, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all deny assignments for the subscription. + * + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or + * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified + * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the + * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and + * below the scope for the specified principal. This filter is different from the principalId filter as it + * returns not only those deny assignments that contain the specified principal is the Principals list but also + * those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when + * gdprExportPrincipalId filter is used, only the deny assignment name and description properties 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 all deny assignments for the subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter) { + return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all deny assignments 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 all deny assignments for the subscription 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)); + } + + /** + * Gets all deny assignments for the subscription. + * + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or + * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified + * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the + * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and + * below the scope for the specified principal. This filter is different from the principalId filter as it + * returns not only those deny assignments that contain the specified principal is the Principals list but also + * those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when + * gdprExportPrincipalId filter is used, only the deny assignment name and description properties 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 all deny assignments for the subscription 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)); + } + + /** + * Gets all deny assignments 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 all deny assignments for the subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String filter = null; + return new PagedIterable<>(listAsync(filter)); + } + + /** + * Gets all deny assignments for the subscription. + * + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or + * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified + * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the + * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and + * below the scope for the specified principal. This filter is different from the principalId filter as it + * returns not only those deny assignments that contain the specified principal is the Principals list but also + * those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when + * gdprExportPrincipalId filter is used, only the deny assignment name and description properties 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 all deny assignments for the subscription 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 specified deny assignment. + * + * @param scope The scope of the deny assignment. + * @param denyAssignmentId The ID of the deny assignment to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified deny assignment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String scope, String denyAssignmentId) { + 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 (denyAssignmentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter denyAssignmentId is required and cannot be null.")); + } + final String apiVersion = "2022-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.get(this.client.getEndpoint(), scope, denyAssignmentId, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the specified deny assignment. + * + * @param scope The scope of the deny assignment. + * @param denyAssignmentId The ID of the deny assignment to get. + * @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 specified deny assignment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String scope, String denyAssignmentId, 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 (denyAssignmentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter denyAssignmentId is required and cannot be null.")); + } + final String apiVersion = "2022-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), scope, denyAssignmentId, apiVersion, accept, context); + } + + /** + * Get the specified deny assignment. + * + * @param scope The scope of the deny assignment. + * @param denyAssignmentId The ID of the deny assignment to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified deny assignment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String scope, String denyAssignmentId) { + return getWithResponseAsync(scope, denyAssignmentId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the specified deny assignment. + * + * @param scope The scope of the deny assignment. + * @param denyAssignmentId The ID of the deny assignment to get. + * @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 specified deny assignment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String scope, String denyAssignmentId, Context context) { + return getWithResponseAsync(scope, denyAssignmentId, context).block(); + } + + /** + * Get the specified deny assignment. + * + * @param scope The scope of the deny assignment. + * @param denyAssignmentId The ID of the deny assignment to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified deny assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DenyAssignmentInner get(String scope, String denyAssignmentId) { + return getWithResponse(scope, denyAssignmentId, Context.NONE).getValue(); + } + + /** + * Gets a deny assignment by ID. + * + * @param denyAssignmentId The fully qualified deny assignment ID. For example, use the format, + * /subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for subscription + * level deny assignments, or /providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for tenant + * level deny assignments. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deny assignment by ID along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByIdWithResponseAsync(String denyAssignmentId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (denyAssignmentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter denyAssignmentId is required and cannot be null.")); + } + final String apiVersion = "2022-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getById(this.client.getEndpoint(), denyAssignmentId, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a deny assignment by ID. + * + * @param denyAssignmentId The fully qualified deny assignment ID. For example, use the format, + * /subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for subscription + * level deny assignments, or /providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for tenant + * level deny assignments. + * @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 a deny assignment by ID along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByIdWithResponseAsync(String denyAssignmentId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (denyAssignmentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter denyAssignmentId is required and cannot be null.")); + } + final String apiVersion = "2022-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getById(this.client.getEndpoint(), denyAssignmentId, apiVersion, accept, context); + } + + /** + * Gets a deny assignment by ID. + * + * @param denyAssignmentId The fully qualified deny assignment ID. For example, use the format, + * /subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for subscription + * level deny assignments, or /providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for tenant + * level deny assignments. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deny assignment by ID on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByIdAsync(String denyAssignmentId) { + return getByIdWithResponseAsync(denyAssignmentId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a deny assignment by ID. + * + * @param denyAssignmentId The fully qualified deny assignment ID. For example, use the format, + * /subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for subscription + * level deny assignments, or /providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for tenant + * level deny assignments. + * @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 a deny assignment by ID along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByIdWithResponse(String denyAssignmentId, Context context) { + return getByIdWithResponseAsync(denyAssignmentId, context).block(); + } + + /** + * Gets a deny assignment by ID. + * + * @param denyAssignmentId The fully qualified deny assignment ID. For example, use the format, + * /subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for subscription + * level deny assignments, or /providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for tenant + * level deny assignments. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deny assignment by ID. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DenyAssignmentInner getById(String denyAssignmentId) { + return getByIdWithResponse(denyAssignmentId, Context.NONE).getValue(); + } + + /** + * Gets deny assignments for a scope. + * + * @param scope The scope of the deny assignments. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or + * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified + * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the + * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and + * below the scope for the specified principal. This filter is different from the principalId filter as it + * returns not only those deny assignments that contain the specified principal is the Principals list but also + * those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when + * gdprExportPrincipalId filter is used, only the deny assignment name and description properties 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 deny assignments for a scope along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeSinglePageAsync(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 apiVersion = "2022-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listForScope(this.client.getEndpoint(), scope, apiVersion, 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())); + } + + /** + * Gets deny assignments for a scope. + * + * @param scope The scope of the deny assignments. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or + * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified + * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the + * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and + * below the scope for the specified principal. This filter is different from the principalId filter as it + * returns not only those deny assignments that contain the specified principal is the Principals list but also + * those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when + * gdprExportPrincipalId filter is used, only the deny assignment name and description properties 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 deny assignments for a scope along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeSinglePageAsync( + 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 apiVersion = "2022-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listForScope(this.client.getEndpoint(), scope, apiVersion, filter, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets deny assignments for a scope. + * + * @param scope The scope of the deny assignments. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or + * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified + * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the + * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and + * below the scope for the specified principal. This filter is different from the principalId filter as it + * returns not only those deny assignments that contain the specified principal is the Principals list but also + * those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when + * gdprExportPrincipalId filter is used, only the deny assignment name and description properties 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 deny assignments for a scope as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForScopeAsync(String scope, String filter) { + return new PagedFlux<>( + () -> listForScopeSinglePageAsync(scope, filter), nextLink -> listForScopeNextSinglePageAsync(nextLink)); + } + + /** + * Gets deny assignments for a scope. + * + * @param scope The scope of the deny assignments. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deny assignments for a scope as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForScopeAsync(String scope) { + final String filter = null; + return new PagedFlux<>( + () -> listForScopeSinglePageAsync(scope, filter), nextLink -> listForScopeNextSinglePageAsync(nextLink)); + } + + /** + * Gets deny assignments for a scope. + * + * @param scope The scope of the deny assignments. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or + * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified + * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the + * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and + * below the scope for the specified principal. This filter is different from the principalId filter as it + * returns not only those deny assignments that contain the specified principal is the Principals list but also + * those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when + * gdprExportPrincipalId filter is used, only the deny assignment name and description properties 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 deny assignments for a scope as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForScopeAsync(String scope, String filter, Context context) { + return new PagedFlux<>( + () -> listForScopeSinglePageAsync(scope, filter, context), + nextLink -> listForScopeNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets deny assignments for a scope. + * + * @param scope The scope of the deny assignments. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deny assignments for a scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForScope(String scope) { + final String filter = null; + return new PagedIterable<>(listForScopeAsync(scope, filter)); + } + + /** + * Gets deny assignments for a scope. + * + * @param scope The scope of the deny assignments. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or + * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified + * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the + * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and + * below the scope for the specified principal. This filter is different from the principalId filter as it + * returns not only those deny assignments that contain the specified principal is the Principals list but also + * those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when + * gdprExportPrincipalId filter is used, only the deny assignment name and description properties 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 deny assignments for a scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForScope(String scope, String filter, Context context) { + return new PagedIterable<>(listForScopeAsync(scope, 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 deny assignment list operation result along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForResourceNextSinglePageAsync(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.listForResourceNext(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 deny assignment list operation result along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForResourceNextSinglePageAsync( + 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 + .listForResourceNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 deny assignment list operation result along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForResourceGroupNextSinglePageAsync(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.listForResourceGroupNext(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 deny assignment list operation result along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForResourceGroupNextSinglePageAsync( + 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 + .listForResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 deny assignment list operation result 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 deny assignment list operation result 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)); + } + + /** + * 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 deny assignment list operation result along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeNextSinglePageAsync(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.listForScopeNext(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 deny assignment list operation result along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeNextSinglePageAsync(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 + .listForScopeNext(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/DenyAssignmentsImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/DenyAssignmentsImpl.java new file mode 100644 index 000000000000..27103f575e10 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/DenyAssignmentsImpl.java @@ -0,0 +1,149 @@ +// 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.DenyAssignmentsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.DenyAssignmentInner; +import com.azure.resourcemanager.authorization.generated.models.DenyAssignment; +import com.azure.resourcemanager.authorization.generated.models.DenyAssignments; + +public final class DenyAssignmentsImpl implements DenyAssignments { + private static final ClientLogger LOGGER = new ClientLogger(DenyAssignmentsImpl.class); + + private final DenyAssignmentsClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public DenyAssignmentsImpl( + DenyAssignmentsClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listForResource( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName) { + PagedIterable inner = + this + .serviceClient() + .listForResource( + resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName); + return Utils.mapPage(inner, inner1 -> new DenyAssignmentImpl(inner1, this.manager())); + } + + public PagedIterable listForResource( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String filter, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listForResource( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + filter, + context); + return Utils.mapPage(inner, inner1 -> new DenyAssignmentImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new DenyAssignmentImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, String filter, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, filter, context); + return Utils.mapPage(inner, inner1 -> new DenyAssignmentImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new DenyAssignmentImpl(inner1, this.manager())); + } + + public PagedIterable list(String filter, Context context) { + PagedIterable inner = this.serviceClient().list(filter, context); + return Utils.mapPage(inner, inner1 -> new DenyAssignmentImpl(inner1, this.manager())); + } + + public Response getWithResponse(String scope, String denyAssignmentId, Context context) { + Response inner = this.serviceClient().getWithResponse(scope, denyAssignmentId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DenyAssignmentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DenyAssignment get(String scope, String denyAssignmentId) { + DenyAssignmentInner inner = this.serviceClient().get(scope, denyAssignmentId); + if (inner != null) { + return new DenyAssignmentImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByIdWithResponse(String denyAssignmentId, Context context) { + Response inner = this.serviceClient().getByIdWithResponse(denyAssignmentId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DenyAssignmentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DenyAssignment getById(String denyAssignmentId) { + DenyAssignmentInner inner = this.serviceClient().getById(denyAssignmentId); + if (inner != null) { + return new DenyAssignmentImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listForScope(String scope) { + PagedIterable inner = this.serviceClient().listForScope(scope); + return Utils.mapPage(inner, inner1 -> new DenyAssignmentImpl(inner1, this.manager())); + } + + public PagedIterable listForScope(String scope, String filter, Context context) { + PagedIterable inner = this.serviceClient().listForScope(scope, filter, context); + return Utils.mapPage(inner, inner1 -> new DenyAssignmentImpl(inner1, this.manager())); + } + + private DenyAssignmentsClient 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/EligibleChildResourceImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/EligibleChildResourceImpl.java new file mode 100644 index 000000000000..3c42fb952907 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/EligibleChildResourceImpl.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.implementation; + +import com.azure.resourcemanager.authorization.generated.fluent.models.EligibleChildResourceInner; +import com.azure.resourcemanager.authorization.generated.models.EligibleChildResource; + +public final class EligibleChildResourceImpl implements EligibleChildResource { + private EligibleChildResourceInner innerObject; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + EligibleChildResourceImpl( + EligibleChildResourceInner 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 EligibleChildResourceInner 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/EligibleChildResourcesClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/EligibleChildResourcesClientImpl.java new file mode 100644 index 000000000000..b4047e727a31 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/EligibleChildResourcesClientImpl.java @@ -0,0 +1,333 @@ +// 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.EligibleChildResourcesClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.EligibleChildResourceInner; +import com.azure.resourcemanager.authorization.generated.models.EligibleChildResourcesListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in EligibleChildResourcesClient. */ +public final class EligibleChildResourcesClientImpl implements EligibleChildResourcesClient { + /** The proxy service used to perform REST calls. */ + private final EligibleChildResourcesService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of EligibleChildResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EligibleChildResourcesClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy + .create(EligibleChildResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AuthorizationManagementClientEligibleChildResources to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + public interface EligibleChildResourcesService { + @Headers({"Content-Type: application/json"}) + @Get("/{scope}/providers/Microsoft.Authorization/eligibleChildResources") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @QueryParam("$filter") String filter, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the child resources of a resource on which user has eligible access. + * + * @param scope The scope of the role management policy. + * @param filter The filter to apply on the operation. Use $filter=resourceType+eq+'Subscription' to filter on only + * resource of type = 'Subscription'. Use + * $filter=resourceType+eq+'subscription'+or+resourceType+eq+'resourcegroup' to filter on resource of type = + * 'Subscription' or 'ResourceGroup'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 child resources of a resource on which user has eligible access along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getSinglePageAsync(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 apiVersion = "2020-10-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), scope, filter, apiVersion, 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 child resources of a resource on which user has eligible access. + * + * @param scope The scope of the role management policy. + * @param filter The filter to apply on the operation. Use $filter=resourceType+eq+'Subscription' to filter on only + * resource of type = 'Subscription'. Use + * $filter=resourceType+eq+'subscription'+or+resourceType+eq+'resourcegroup' to filter on resource of type = + * 'Subscription' or 'ResourceGroup'. + * @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 child resources of a resource on which user has eligible access along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getSinglePageAsync( + 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 apiVersion = "2020-10-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get(this.client.getEndpoint(), scope, filter, apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the child resources of a resource on which user has eligible access. + * + * @param scope The scope of the role management policy. + * @param filter The filter to apply on the operation. Use $filter=resourceType+eq+'Subscription' to filter on only + * resource of type = 'Subscription'. Use + * $filter=resourceType+eq+'subscription'+or+resourceType+eq+'resourcegroup' to filter on resource of type = + * 'Subscription' or 'ResourceGroup'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 child resources of a resource on which user has eligible access as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux getAsync(String scope, String filter) { + return new PagedFlux<>(() -> getSinglePageAsync(scope, filter), nextLink -> getNextSinglePageAsync(nextLink)); + } + + /** + * Get the child resources of a resource on which user has eligible access. + * + * @param scope The scope of the role management policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 child resources of a resource on which user has eligible access as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux getAsync(String scope) { + final String filter = null; + return new PagedFlux<>(() -> getSinglePageAsync(scope, filter), nextLink -> getNextSinglePageAsync(nextLink)); + } + + /** + * Get the child resources of a resource on which user has eligible access. + * + * @param scope The scope of the role management policy. + * @param filter The filter to apply on the operation. Use $filter=resourceType+eq+'Subscription' to filter on only + * resource of type = 'Subscription'. Use + * $filter=resourceType+eq+'subscription'+or+resourceType+eq+'resourcegroup' to filter on resource of type = + * 'Subscription' or 'ResourceGroup'. + * @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 child resources of a resource on which user has eligible access as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux getAsync(String scope, String filter, Context context) { + return new PagedFlux<>( + () -> getSinglePageAsync(scope, filter, context), nextLink -> getNextSinglePageAsync(nextLink, context)); + } + + /** + * Get the child resources of a resource on which user has eligible access. + * + * @param scope The scope of the role management policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 child resources of a resource on which user has eligible access as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable get(String scope) { + final String filter = null; + return new PagedIterable<>(getAsync(scope, filter)); + } + + /** + * Get the child resources of a resource on which user has eligible access. + * + * @param scope The scope of the role management policy. + * @param filter The filter to apply on the operation. Use $filter=resourceType+eq+'Subscription' to filter on only + * resource of type = 'Subscription'. Use + * $filter=resourceType+eq+'subscription'+or+resourceType+eq+'resourcegroup' to filter on resource of type = + * 'Subscription' or 'ResourceGroup'. + * @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 child resources of a resource on which user has eligible access as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable get(String scope, String filter, Context context) { + return new PagedIterable<>(getAsync(scope, 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 eligible child resources list operation result along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getNextSinglePageAsync(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.getNext(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 eligible child resources list operation result along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getNextSinglePageAsync(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 + .getNext(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/EligibleChildResourcesImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/EligibleChildResourcesImpl.java new file mode 100644 index 000000000000..c81448d1baa0 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/EligibleChildResourcesImpl.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.EligibleChildResourcesClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.EligibleChildResourceInner; +import com.azure.resourcemanager.authorization.generated.models.EligibleChildResource; +import com.azure.resourcemanager.authorization.generated.models.EligibleChildResources; + +public final class EligibleChildResourcesImpl implements EligibleChildResources { + private static final ClientLogger LOGGER = new ClientLogger(EligibleChildResourcesImpl.class); + + private final EligibleChildResourcesClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public EligibleChildResourcesImpl( + EligibleChildResourcesClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable get(String scope) { + PagedIterable inner = this.serviceClient().get(scope); + return Utils.mapPage(inner, inner1 -> new EligibleChildResourceImpl(inner1, this.manager())); + } + + public PagedIterable get(String scope, String filter, Context context) { + PagedIterable inner = this.serviceClient().get(scope, filter, context); + return Utils.mapPage(inner, inner1 -> new EligibleChildResourceImpl(inner1, this.manager())); + } + + private EligibleChildResourcesClient 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/GlobalAdministratorsClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/GlobalAdministratorsClientImpl.java new file mode 100644 index 000000000000..ef91e7c237e5 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/GlobalAdministratorsClientImpl.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.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.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.GlobalAdministratorsClient; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in GlobalAdministratorsClient. */ +public final class GlobalAdministratorsClientImpl implements GlobalAdministratorsClient { + /** The proxy service used to perform REST calls. */ + private final GlobalAdministratorsService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of GlobalAdministratorsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GlobalAdministratorsClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy + .create(GlobalAdministratorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AuthorizationManagementClientGlobalAdministrators to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + public interface GlobalAdministratorsService { + @Headers({"Content-Type: application/json"}) + @Post("/providers/Microsoft.Authorization/elevateAccess") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> elevateAccess( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Elevates access for a Global Administrator. + * + * @throws 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> elevateAccessWithResponseAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String apiVersion = "2015-07-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.elevateAccess(this.client.getEndpoint(), apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Elevates access for a Global Administrator. + * + * @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> elevateAccessWithResponseAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String apiVersion = "2015-07-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.elevateAccess(this.client.getEndpoint(), apiVersion, accept, context); + } + + /** + * Elevates access for a Global Administrator. + * + * @throws 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 elevateAccessAsync() { + return elevateAccessWithResponseAsync().flatMap(ignored -> Mono.empty()); + } + + /** + * Elevates access for a Global Administrator. + * + * @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 elevateAccessWithResponse(Context context) { + return elevateAccessWithResponseAsync(context).block(); + } + + /** + * Elevates access for a Global Administrator. + * + * @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 elevateAccess() { + elevateAccessWithResponse(Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/GlobalAdministratorsImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/GlobalAdministratorsImpl.java new file mode 100644 index 000000000000..d57247705a5c --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/GlobalAdministratorsImpl.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.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.GlobalAdministratorsClient; +import com.azure.resourcemanager.authorization.generated.models.GlobalAdministrators; + +public final class GlobalAdministratorsImpl implements GlobalAdministrators { + private static final ClientLogger LOGGER = new ClientLogger(GlobalAdministratorsImpl.class); + + private final GlobalAdministratorsClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public GlobalAdministratorsImpl( + GlobalAdministratorsClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response elevateAccessWithResponse(Context context) { + return this.serviceClient().elevateAccessWithResponse(context); + } + + public void elevateAccess() { + this.serviceClient().elevateAccess(); + } + + private GlobalAdministratorsClient 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/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 000000000000..105fd71fa553 --- /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 000000000000..71bf1a05cd03 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/OperationsClientImpl.java @@ -0,0 +1,277 @@ +// 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") + public 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, 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 000000000000..bf4e61234fed --- /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/PermissionImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/PermissionImpl.java new file mode 100644 index 000000000000..d5221bf271f0 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/PermissionImpl.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.PermissionInner; +import com.azure.resourcemanager.authorization.generated.models.Permission; +import java.util.Collections; +import java.util.List; + +public final class PermissionImpl implements Permission { + private PermissionInner innerObject; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + PermissionImpl( + PermissionInner innerObject, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List actions() { + List inner = this.innerModel().actions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List notActions() { + List inner = this.innerModel().notActions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List dataActions() { + List inner = this.innerModel().dataActions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List notDataActions() { + List inner = this.innerModel().notDataActions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String condition() { + return this.innerModel().condition(); + } + + public String conditionVersion() { + return this.innerModel().conditionVersion(); + } + + public PermissionInner 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/PermissionsClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/PermissionsClientImpl.java new file mode 100644 index 000000000000..b3a282c05ee8 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/PermissionsClientImpl.java @@ -0,0 +1,700 @@ +// 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.PermissionsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.PermissionInner; +import com.azure.resourcemanager.authorization.generated.models.PermissionGetResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PermissionsClient. */ +public final class PermissionsClientImpl implements PermissionsClient { + /** The proxy service used to perform REST calls. */ + private final PermissionsService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of PermissionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PermissionsClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy.create(PermissionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AuthorizationManagementClientPermissions to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + public interface PermissionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Authorization/permissions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/permissions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForResource( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam(value = "resourceProviderNamespace", encoded = true) String resourceProviderNamespace, + @PathParam(value = "parentResourcePath", encoded = true) String parentResourcePath, + @PathParam(value = "resourceType", encoded = true) String resourceType, + @PathParam("resourceName") String resourceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForResourceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all permissions the caller has for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all permissions the caller has for a resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 apiVersion = "2022-05-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + 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())); + } + + /** + * Gets all permissions the caller has for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 all permissions the caller has for a resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName 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 apiVersion = "2022-05-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all permissions the caller has for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all permissions the caller has for a resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listForResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets all permissions the caller has for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 all permissions the caller has for a resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listForResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all permissions the caller has for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all permissions the caller has for a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all permissions the caller has for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 all permissions the caller has for a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all permissions the caller has for a resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get the permissions 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 all permissions the caller has for a resource along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForResourceSinglePageAsync( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceProviderNamespace == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter resourceProviderNamespace is required and cannot be null.")); + } + if (parentResourcePath == null) { + return Mono + .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName 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 apiVersion = "2022-05-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listForResource( + this.client.getEndpoint(), + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + this.client.getSubscriptionId(), + 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())); + } + + /** + * Gets all permissions the caller has for a resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get the permissions 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 all permissions the caller has for a resource along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForResourceSinglePageAsync( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceProviderNamespace == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter resourceProviderNamespace is required and cannot be null.")); + } + if (parentResourcePath == null) { + return Mono + .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName 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 apiVersion = "2022-05-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listForResource( + this.client.getEndpoint(), + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all permissions the caller has for a resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get the permissions 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 all permissions the caller has for a resource as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForResourceAsync( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName) { + return new PagedFlux<>( + () -> + listForResourceSinglePageAsync( + resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName), + nextLink -> listForResourceNextSinglePageAsync(nextLink)); + } + + /** + * Gets all permissions the caller has for a resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get the permissions 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 all permissions the caller has for a resource as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForResourceAsync( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + Context context) { + return new PagedFlux<>( + () -> + listForResourceSinglePageAsync( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + context), + nextLink -> listForResourceNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all permissions the caller has for a resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get the permissions 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 all permissions the caller has for a resource as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForResource( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName) { + return new PagedIterable<>( + listForResourceAsync( + resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName)); + } + + /** + * Gets all permissions the caller has for a resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get the permissions 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 all permissions the caller has for a resource as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForResource( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + Context context) { + return new PagedIterable<>( + listForResourceAsync( + resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, 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 permissions information along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForResourceGroupNextSinglePageAsync(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.listForResourceGroupNext(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 permissions information along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForResourceGroupNextSinglePageAsync( + 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 + .listForResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 permissions information along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForResourceNextSinglePageAsync(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.listForResourceNext(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 permissions information along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForResourceNextSinglePageAsync(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 + .listForResourceNext(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/PermissionsImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/PermissionsImpl.java new file mode 100644 index 000000000000..42893be4cf20 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/PermissionsImpl.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.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.PermissionsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.PermissionInner; +import com.azure.resourcemanager.authorization.generated.models.Permission; +import com.azure.resourcemanager.authorization.generated.models.Permissions; + +public final class PermissionsImpl implements Permissions { + private static final ClientLogger LOGGER = new ClientLogger(PermissionsImpl.class); + + private final PermissionsClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public PermissionsImpl( + PermissionsClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new PermissionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new PermissionImpl(inner1, this.manager())); + } + + public PagedIterable listForResource( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName) { + PagedIterable inner = + this + .serviceClient() + .listForResource( + resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName); + return Utils.mapPage(inner, inner1 -> new PermissionImpl(inner1, this.manager())); + } + + public PagedIterable listForResource( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listForResource( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + context); + return Utils.mapPage(inner, inner1 -> new PermissionImpl(inner1, this.manager())); + } + + private PermissionsClient 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/ProviderOperationsMetadataImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ProviderOperationsMetadataImpl.java new file mode 100644 index 000000000000..bacdc3e1b792 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ProviderOperationsMetadataImpl.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.implementation; + +import com.azure.resourcemanager.authorization.generated.fluent.models.ProviderOperationsMetadataInner; +import com.azure.resourcemanager.authorization.generated.models.ProviderOperation; +import com.azure.resourcemanager.authorization.generated.models.ProviderOperationsMetadata; +import com.azure.resourcemanager.authorization.generated.models.ResourceType; +import java.util.Collections; +import java.util.List; + +public final class ProviderOperationsMetadataImpl implements ProviderOperationsMetadata { + private ProviderOperationsMetadataInner innerObject; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + ProviderOperationsMetadataImpl( + ProviderOperationsMetadataInner 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 List resourceTypes() { + List inner = this.innerModel().resourceTypes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List operations() { + List inner = this.innerModel().operations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProviderOperationsMetadataInner 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/ProviderOperationsMetadatasClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ProviderOperationsMetadatasClientImpl.java new file mode 100644 index 000000000000..257d326ed6fa --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ProviderOperationsMetadatasClientImpl.java @@ -0,0 +1,427 @@ +// 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.ProviderOperationsMetadatasClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.ProviderOperationsMetadataInner; +import com.azure.resourcemanager.authorization.generated.models.ProviderOperationsMetadataListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ProviderOperationsMetadatasClient. */ +public final class ProviderOperationsMetadatasClientImpl implements ProviderOperationsMetadatasClient { + /** The proxy service used to perform REST calls. */ + private final ProviderOperationsMetadatasService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of ProviderOperationsMetadatasClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProviderOperationsMetadatasClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy + .create( + ProviderOperationsMetadatasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AuthorizationManagementClientProviderOperationsMetadatas to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + public interface ProviderOperationsMetadatasService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Authorization/providerOperations/{resourceProviderNamespace}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceProviderNamespace", encoded = true) String resourceProviderNamespace, + @QueryParam("api-version") String apiVersion, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Authorization/providerOperations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @QueryParam("$expand") String expand, + @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); + } + + /** + * Gets provider operations metadata for the specified resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @param expand Specifies whether to expand the values. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return provider operations metadata for the specified resource provider along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceProviderNamespace, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceProviderNamespace == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter resourceProviderNamespace is required and cannot be null.")); + } + final String apiVersion = "2022-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get(this.client.getEndpoint(), resourceProviderNamespace, apiVersion, expand, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets provider operations metadata for the specified resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @param expand Specifies whether to expand the values. + * @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 provider operations metadata for the specified resource provider along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceProviderNamespace, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceProviderNamespace == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter resourceProviderNamespace is required and cannot be null.")); + } + final String apiVersion = "2022-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceProviderNamespace, apiVersion, expand, accept, context); + } + + /** + * Gets provider operations metadata for the specified resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return provider operations metadata for the specified resource provider on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceProviderNamespace) { + final String expand = null; + return getWithResponseAsync(resourceProviderNamespace, expand).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets provider operations metadata for the specified resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @param expand Specifies whether to expand the values. + * @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 provider operations metadata for the specified resource provider along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceProviderNamespace, String expand, Context context) { + return getWithResponseAsync(resourceProviderNamespace, expand, context).block(); + } + + /** + * Gets provider operations metadata for the specified resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return provider operations metadata for the specified resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProviderOperationsMetadataInner get(String resourceProviderNamespace) { + final String expand = null; + return getWithResponse(resourceProviderNamespace, expand, Context.NONE).getValue(); + } + + /** + * Gets provider operations metadata for all resource providers. + * + * @param expand Specifies whether to expand the values. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return provider operations metadata for all resource providers along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String apiVersion = "2022-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, expand, 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())); + } + + /** + * Gets provider operations metadata for all resource providers. + * + * @param expand Specifies whether to expand the values. + * @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 provider operations metadata for all resource providers along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String apiVersion = "2022-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, expand, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets provider operations metadata for all resource providers. + * + * @param expand Specifies whether to expand the values. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return provider operations metadata for all resource providers as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String expand) { + return new PagedFlux<>(() -> listSinglePageAsync(expand), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets provider operations metadata for all resource providers. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return provider operations metadata for all resource providers as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String expand = null; + return new PagedFlux<>(() -> listSinglePageAsync(expand), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets provider operations metadata for all resource providers. + * + * @param expand Specifies whether to expand the values. + * @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 provider operations metadata for all resource providers as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String expand, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(expand, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets provider operations metadata for all resource providers. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return provider operations metadata for all resource providers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String expand = null; + return new PagedIterable<>(listAsync(expand)); + } + + /** + * Gets provider operations metadata for all resource providers. + * + * @param expand Specifies whether to expand the values. + * @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 provider operations metadata for all resource providers as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String expand, Context context) { + return new PagedIterable<>(listAsync(expand, 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 provider operations metadata list 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 provider operations metadata list 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/ProviderOperationsMetadatasImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ProviderOperationsMetadatasImpl.java new file mode 100644 index 000000000000..a863d3bc6d4b --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ProviderOperationsMetadatasImpl.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.ProviderOperationsMetadatasClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.ProviderOperationsMetadataInner; +import com.azure.resourcemanager.authorization.generated.models.ProviderOperationsMetadata; +import com.azure.resourcemanager.authorization.generated.models.ProviderOperationsMetadatas; + +public final class ProviderOperationsMetadatasImpl implements ProviderOperationsMetadatas { + private static final ClientLogger LOGGER = new ClientLogger(ProviderOperationsMetadatasImpl.class); + + private final ProviderOperationsMetadatasClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public ProviderOperationsMetadatasImpl( + ProviderOperationsMetadatasClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceProviderNamespace, String expand, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceProviderNamespace, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProviderOperationsMetadataImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ProviderOperationsMetadata get(String resourceProviderNamespace) { + ProviderOperationsMetadataInner inner = this.serviceClient().get(resourceProviderNamespace); + if (inner != null) { + return new ProviderOperationsMetadataImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ProviderOperationsMetadataImpl(inner1, this.manager())); + } + + public PagedIterable list(String expand, Context context) { + PagedIterable inner = this.serviceClient().list(expand, context); + return Utils.mapPage(inner, inner1 -> new ProviderOperationsMetadataImpl(inner1, this.manager())); + } + + private ProviderOperationsMetadatasClient 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/RoleAssignmentImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleAssignmentImpl.java new file mode 100644 index 000000000000..cdd959bd98a0 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleAssignmentImpl.java @@ -0,0 +1,189 @@ +// 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.RoleAssignmentInner; +import com.azure.resourcemanager.authorization.generated.models.PrincipalType; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignment; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignmentCreateParameters; +import java.time.OffsetDateTime; + +public final class RoleAssignmentImpl implements RoleAssignment, RoleAssignment.Definition { + private RoleAssignmentInner innerObject; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + RoleAssignmentImpl( + RoleAssignmentInner 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 scope() { + return this.innerModel().scope(); + } + + public String roleDefinitionId() { + return this.innerModel().roleDefinitionId(); + } + + public String principalId() { + return this.innerModel().principalId(); + } + + public PrincipalType principalType() { + return this.innerModel().principalType(); + } + + public String description() { + return this.innerModel().description(); + } + + public String condition() { + return this.innerModel().condition(); + } + + public String conditionVersion() { + return this.innerModel().conditionVersion(); + } + + public OffsetDateTime createdOn() { + return this.innerModel().createdOn(); + } + + public OffsetDateTime updatedOn() { + return this.innerModel().updatedOn(); + } + + public String createdBy() { + return this.innerModel().createdBy(); + } + + public String updatedBy() { + return this.innerModel().updatedBy(); + } + + public String delegatedManagedIdentityResourceId() { + return this.innerModel().delegatedManagedIdentityResourceId(); + } + + public RoleAssignmentInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } + + private String scope; + + private String roleAssignmentName; + + private RoleAssignmentCreateParameters createParameters; + + public RoleAssignmentImpl withExistingScope(String scope) { + this.scope = scope; + return this; + } + + public RoleAssignment create() { + this.innerObject = + serviceManager + .serviceClient() + .getRoleAssignments() + .createWithResponse(scope, roleAssignmentName, createParameters, Context.NONE) + .getValue(); + return this; + } + + public RoleAssignment create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRoleAssignments() + .createWithResponse(scope, roleAssignmentName, createParameters, context) + .getValue(); + return this; + } + + RoleAssignmentImpl( + String name, com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerObject = new RoleAssignmentInner(); + this.serviceManager = serviceManager; + this.roleAssignmentName = name; + this.createParameters = new RoleAssignmentCreateParameters(); + } + + public RoleAssignment refresh() { + String localTenantId = null; + this.innerObject = + serviceManager + .serviceClient() + .getRoleAssignments() + .getWithResponse(scope, roleAssignmentName, localTenantId, Context.NONE) + .getValue(); + return this; + } + + public RoleAssignment refresh(Context context) { + String localTenantId = null; + this.innerObject = + serviceManager + .serviceClient() + .getRoleAssignments() + .getWithResponse(scope, roleAssignmentName, localTenantId, context) + .getValue(); + return this; + } + + public RoleAssignmentImpl withRoleDefinitionId(String roleDefinitionId) { + this.createParameters.withRoleDefinitionId(roleDefinitionId); + return this; + } + + public RoleAssignmentImpl withPrincipalId(String principalId) { + this.createParameters.withPrincipalId(principalId); + return this; + } + + public RoleAssignmentImpl withPrincipalType(PrincipalType principalType) { + this.createParameters.withPrincipalType(principalType); + return this; + } + + public RoleAssignmentImpl withDescription(String description) { + this.createParameters.withDescription(description); + return this; + } + + public RoleAssignmentImpl withCondition(String condition) { + this.createParameters.withCondition(condition); + return this; + } + + public RoleAssignmentImpl withConditionVersion(String conditionVersion) { + this.createParameters.withConditionVersion(conditionVersion); + return this; + } + + public RoleAssignmentImpl withDelegatedManagedIdentityResourceId(String delegatedManagedIdentityResourceId) { + this.createParameters.withDelegatedManagedIdentityResourceId(delegatedManagedIdentityResourceId); + return this; + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleAssignmentScheduleImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleAssignmentScheduleImpl.java new file mode 100644 index 000000000000..9e9d1aaa03f7 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleAssignmentScheduleImpl.java @@ -0,0 +1,111 @@ +// 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.RoleAssignmentScheduleInner; +import com.azure.resourcemanager.authorization.generated.models.AssignmentType; +import com.azure.resourcemanager.authorization.generated.models.ExpandedProperties; +import com.azure.resourcemanager.authorization.generated.models.MemberType; +import com.azure.resourcemanager.authorization.generated.models.PrincipalType; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignmentSchedule; +import com.azure.resourcemanager.authorization.generated.models.Status; +import java.time.OffsetDateTime; + +public final class RoleAssignmentScheduleImpl implements RoleAssignmentSchedule { + private RoleAssignmentScheduleInner innerObject; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + RoleAssignmentScheduleImpl( + RoleAssignmentScheduleInner 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 scope() { + return this.innerModel().scope(); + } + + public String roleDefinitionId() { + return this.innerModel().roleDefinitionId(); + } + + public String principalId() { + return this.innerModel().principalId(); + } + + public PrincipalType principalType() { + return this.innerModel().principalType(); + } + + public String roleAssignmentScheduleRequestId() { + return this.innerModel().roleAssignmentScheduleRequestId(); + } + + public String linkedRoleEligibilityScheduleId() { + return this.innerModel().linkedRoleEligibilityScheduleId(); + } + + public AssignmentType assignmentType() { + return this.innerModel().assignmentType(); + } + + public MemberType memberType() { + return this.innerModel().memberType(); + } + + public Status status() { + return this.innerModel().status(); + } + + public OffsetDateTime startDateTime() { + return this.innerModel().startDateTime(); + } + + public OffsetDateTime endDateTime() { + return this.innerModel().endDateTime(); + } + + public String condition() { + return this.innerModel().condition(); + } + + public String conditionVersion() { + return this.innerModel().conditionVersion(); + } + + public OffsetDateTime createdOn() { + return this.innerModel().createdOn(); + } + + public OffsetDateTime updatedOn() { + return this.innerModel().updatedOn(); + } + + public ExpandedProperties expandedProperties() { + return this.innerModel().expandedProperties(); + } + + public RoleAssignmentScheduleInner 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/RoleAssignmentScheduleInstanceImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleAssignmentScheduleInstanceImpl.java new file mode 100644 index 000000000000..392c455d1304 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleAssignmentScheduleInstanceImpl.java @@ -0,0 +1,115 @@ +// 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.RoleAssignmentScheduleInstanceInner; +import com.azure.resourcemanager.authorization.generated.models.AssignmentType; +import com.azure.resourcemanager.authorization.generated.models.ExpandedProperties; +import com.azure.resourcemanager.authorization.generated.models.MemberType; +import com.azure.resourcemanager.authorization.generated.models.PrincipalType; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignmentScheduleInstance; +import com.azure.resourcemanager.authorization.generated.models.Status; +import java.time.OffsetDateTime; + +public final class RoleAssignmentScheduleInstanceImpl implements RoleAssignmentScheduleInstance { + private RoleAssignmentScheduleInstanceInner innerObject; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + RoleAssignmentScheduleInstanceImpl( + RoleAssignmentScheduleInstanceInner 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 scope() { + return this.innerModel().scope(); + } + + public String roleDefinitionId() { + return this.innerModel().roleDefinitionId(); + } + + public String principalId() { + return this.innerModel().principalId(); + } + + public PrincipalType principalType() { + return this.innerModel().principalType(); + } + + public String roleAssignmentScheduleId() { + return this.innerModel().roleAssignmentScheduleId(); + } + + public String originRoleAssignmentId() { + return this.innerModel().originRoleAssignmentId(); + } + + public Status status() { + return this.innerModel().status(); + } + + public OffsetDateTime startDateTime() { + return this.innerModel().startDateTime(); + } + + public OffsetDateTime endDateTime() { + return this.innerModel().endDateTime(); + } + + public String linkedRoleEligibilityScheduleId() { + return this.innerModel().linkedRoleEligibilityScheduleId(); + } + + public String linkedRoleEligibilityScheduleInstanceId() { + return this.innerModel().linkedRoleEligibilityScheduleInstanceId(); + } + + public AssignmentType assignmentType() { + return this.innerModel().assignmentType(); + } + + public MemberType memberType() { + return this.innerModel().memberType(); + } + + public String condition() { + return this.innerModel().condition(); + } + + public String conditionVersion() { + return this.innerModel().conditionVersion(); + } + + public OffsetDateTime createdOn() { + return this.innerModel().createdOn(); + } + + public ExpandedProperties expandedProperties() { + return this.innerModel().expandedProperties(); + } + + public RoleAssignmentScheduleInstanceInner 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/RoleAssignmentScheduleInstancesClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleAssignmentScheduleInstancesClientImpl.java new file mode 100644 index 000000000000..f061c8b790d8 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleAssignmentScheduleInstancesClientImpl.java @@ -0,0 +1,498 @@ +// 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.RoleAssignmentScheduleInstancesClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleAssignmentScheduleInstanceInner; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignmentScheduleInstanceListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RoleAssignmentScheduleInstancesClient. */ +public final class RoleAssignmentScheduleInstancesClientImpl implements RoleAssignmentScheduleInstancesClient { + /** The proxy service used to perform REST calls. */ + private final RoleAssignmentScheduleInstancesService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of RoleAssignmentScheduleInstancesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RoleAssignmentScheduleInstancesClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy + .create( + RoleAssignmentScheduleInstancesService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AuthorizationManagementClientRoleAssignmentScheduleInstances to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + public interface RoleAssignmentScheduleInstancesService { + @Headers({"Content-Type: application/json"}) + @Get("/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleInstances") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForScope( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @QueryParam("$filter") String filter, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleInstances/{roleAssignmentScheduleInstanceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam("roleAssignmentScheduleInstanceName") String roleAssignmentScheduleInstanceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForScopeNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets role assignment schedule instances of a role assignment schedule. + * + * @param scope The scope of the role assignment schedule. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + * at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or + * below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment + * schedule instances for the user. Use $filter=asTarget() to return all role assignment schedule instances + * created for the current user. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role assignment schedule instances of a role assignment schedule along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeSinglePageAsync( + 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 apiVersion = "2020-10-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listForScope(this.client.getEndpoint(), scope, filter, apiVersion, 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())); + } + + /** + * Gets role assignment schedule instances of a role assignment schedule. + * + * @param scope The scope of the role assignment schedule. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + * at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or + * below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment + * schedule instances for the user. Use $filter=asTarget() to return all role assignment schedule instances + * created for the current user. + * @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 role assignment schedule instances of a role assignment schedule along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeSinglePageAsync( + 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 apiVersion = "2020-10-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listForScope(this.client.getEndpoint(), scope, filter, apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets role assignment schedule instances of a role assignment schedule. + * + * @param scope The scope of the role assignment schedule. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + * at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or + * below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment + * schedule instances for the user. Use $filter=asTarget() to return all role assignment schedule instances + * created for the current user. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role assignment schedule instances of a role assignment schedule as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForScopeAsync(String scope, String filter) { + return new PagedFlux<>( + () -> listForScopeSinglePageAsync(scope, filter), nextLink -> listForScopeNextSinglePageAsync(nextLink)); + } + + /** + * Gets role assignment schedule instances of a role assignment schedule. + * + * @param scope The scope of the role assignment schedule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role assignment schedule instances of a role assignment schedule as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForScopeAsync(String scope) { + final String filter = null; + return new PagedFlux<>( + () -> listForScopeSinglePageAsync(scope, filter), nextLink -> listForScopeNextSinglePageAsync(nextLink)); + } + + /** + * Gets role assignment schedule instances of a role assignment schedule. + * + * @param scope The scope of the role assignment schedule. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + * at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or + * below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment + * schedule instances for the user. Use $filter=asTarget() to return all role assignment schedule instances + * created for the current user. + * @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 role assignment schedule instances of a role assignment schedule as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForScopeAsync( + String scope, String filter, Context context) { + return new PagedFlux<>( + () -> listForScopeSinglePageAsync(scope, filter, context), + nextLink -> listForScopeNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets role assignment schedule instances of a role assignment schedule. + * + * @param scope The scope of the role assignment schedule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role assignment schedule instances of a role assignment schedule as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForScope(String scope) { + final String filter = null; + return new PagedIterable<>(listForScopeAsync(scope, filter)); + } + + /** + * Gets role assignment schedule instances of a role assignment schedule. + * + * @param scope The scope of the role assignment schedule. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + * at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or + * below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment + * schedule instances for the user. Use $filter=asTarget() to return all role assignment schedule instances + * created for the current user. + * @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 role assignment schedule instances of a role assignment schedule as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForScope( + String scope, String filter, Context context) { + return new PagedIterable<>(listForScopeAsync(scope, filter, context)); + } + + /** + * Gets the specified role assignment schedule instance. + * + * @param scope The scope of the role assignments schedules. + * @param roleAssignmentScheduleInstanceName The name (hash of schedule name + time) of the role assignment schedule + * to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified role assignment schedule instance along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String scope, String roleAssignmentScheduleInstanceName) { + 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 (roleAssignmentScheduleInstanceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter roleAssignmentScheduleInstanceName is required and cannot be null.")); + } + final String apiVersion = "2020-10-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + scope, + roleAssignmentScheduleInstanceName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified role assignment schedule instance. + * + * @param scope The scope of the role assignments schedules. + * @param roleAssignmentScheduleInstanceName The name (hash of schedule name + time) of the role assignment schedule + * to get. + * @param 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 specified role assignment schedule instance along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String scope, String roleAssignmentScheduleInstanceName, 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 (roleAssignmentScheduleInstanceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter roleAssignmentScheduleInstanceName is required and cannot be null.")); + } + final String apiVersion = "2020-10-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get(this.client.getEndpoint(), scope, roleAssignmentScheduleInstanceName, apiVersion, accept, context); + } + + /** + * Gets the specified role assignment schedule instance. + * + * @param scope The scope of the role assignments schedules. + * @param roleAssignmentScheduleInstanceName The name (hash of schedule name + time) of the role assignment schedule + * to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified role assignment schedule instance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String scope, String roleAssignmentScheduleInstanceName) { + return getWithResponseAsync(scope, roleAssignmentScheduleInstanceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the specified role assignment schedule instance. + * + * @param scope The scope of the role assignments schedules. + * @param roleAssignmentScheduleInstanceName The name (hash of schedule name + time) of the role assignment schedule + * to get. + * @param 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 specified role assignment schedule instance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String scope, String roleAssignmentScheduleInstanceName, Context context) { + return getWithResponseAsync(scope, roleAssignmentScheduleInstanceName, context).block(); + } + + /** + * Gets the specified role assignment schedule instance. + * + * @param scope The scope of the role assignments schedules. + * @param roleAssignmentScheduleInstanceName The name (hash of schedule name + time) of the role assignment schedule + * to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified role assignment schedule instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoleAssignmentScheduleInstanceInner get(String scope, String roleAssignmentScheduleInstanceName) { + return getWithResponse(scope, roleAssignmentScheduleInstanceName, Context.NONE).getValue(); + } + + /** + * 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 role assignment schedule instance list operation result along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeNextSinglePageAsync(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.listForScopeNext(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 role assignment schedule instance list operation result along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeNextSinglePageAsync( + 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 + .listForScopeNext(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/RoleAssignmentScheduleInstancesImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleAssignmentScheduleInstancesImpl.java new file mode 100644 index 000000000000..b160d4c49313 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleAssignmentScheduleInstancesImpl.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.RoleAssignmentScheduleInstancesClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleAssignmentScheduleInstanceInner; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignmentScheduleInstance; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignmentScheduleInstances; + +public final class RoleAssignmentScheduleInstancesImpl implements RoleAssignmentScheduleInstances { + private static final ClientLogger LOGGER = new ClientLogger(RoleAssignmentScheduleInstancesImpl.class); + + private final RoleAssignmentScheduleInstancesClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public RoleAssignmentScheduleInstancesImpl( + RoleAssignmentScheduleInstancesClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listForScope(String scope) { + PagedIterable inner = this.serviceClient().listForScope(scope); + return Utils.mapPage(inner, inner1 -> new RoleAssignmentScheduleInstanceImpl(inner1, this.manager())); + } + + public PagedIterable listForScope(String scope, String filter, Context context) { + PagedIterable inner = + this.serviceClient().listForScope(scope, filter, context); + return Utils.mapPage(inner, inner1 -> new RoleAssignmentScheduleInstanceImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String scope, String roleAssignmentScheduleInstanceName, Context context) { + Response inner = + this.serviceClient().getWithResponse(scope, roleAssignmentScheduleInstanceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RoleAssignmentScheduleInstanceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RoleAssignmentScheduleInstance get(String scope, String roleAssignmentScheduleInstanceName) { + RoleAssignmentScheduleInstanceInner inner = this.serviceClient().get(scope, roleAssignmentScheduleInstanceName); + if (inner != null) { + return new RoleAssignmentScheduleInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + private RoleAssignmentScheduleInstancesClient 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/RoleAssignmentScheduleRequestImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleAssignmentScheduleRequestImpl.java new file mode 100644 index 000000000000..90011e904412 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleAssignmentScheduleRequestImpl.java @@ -0,0 +1,261 @@ +// 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.RoleAssignmentScheduleRequestInner; +import com.azure.resourcemanager.authorization.generated.models.ExpandedProperties; +import com.azure.resourcemanager.authorization.generated.models.PrincipalType; +import com.azure.resourcemanager.authorization.generated.models.RequestType; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignmentScheduleRequest; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignmentScheduleRequestPropertiesScheduleInfo; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignmentScheduleRequestPropertiesTicketInfo; +import com.azure.resourcemanager.authorization.generated.models.Status; +import java.time.OffsetDateTime; + +public final class RoleAssignmentScheduleRequestImpl + implements RoleAssignmentScheduleRequest, RoleAssignmentScheduleRequest.Definition { + private RoleAssignmentScheduleRequestInner innerObject; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + RoleAssignmentScheduleRequestImpl( + RoleAssignmentScheduleRequestInner 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 scope() { + return this.innerModel().scope(); + } + + public String roleDefinitionId() { + return this.innerModel().roleDefinitionId(); + } + + public String principalId() { + return this.innerModel().principalId(); + } + + public PrincipalType principalType() { + return this.innerModel().principalType(); + } + + public RequestType requestType() { + return this.innerModel().requestType(); + } + + public Status status() { + return this.innerModel().status(); + } + + public String approvalId() { + return this.innerModel().approvalId(); + } + + public String targetRoleAssignmentScheduleId() { + return this.innerModel().targetRoleAssignmentScheduleId(); + } + + public String targetRoleAssignmentScheduleInstanceId() { + return this.innerModel().targetRoleAssignmentScheduleInstanceId(); + } + + public RoleAssignmentScheduleRequestPropertiesScheduleInfo scheduleInfo() { + return this.innerModel().scheduleInfo(); + } + + public String linkedRoleEligibilityScheduleId() { + return this.innerModel().linkedRoleEligibilityScheduleId(); + } + + public String justification() { + return this.innerModel().justification(); + } + + public RoleAssignmentScheduleRequestPropertiesTicketInfo ticketInfo() { + return this.innerModel().ticketInfo(); + } + + public String condition() { + return this.innerModel().condition(); + } + + public String conditionVersion() { + return this.innerModel().conditionVersion(); + } + + public OffsetDateTime createdOn() { + return this.innerModel().createdOn(); + } + + public String requestorId() { + return this.innerModel().requestorId(); + } + + public ExpandedProperties expandedProperties() { + return this.innerModel().expandedProperties(); + } + + public RoleAssignmentScheduleRequestInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } + + private String scope; + + private String roleAssignmentScheduleRequestName; + + public RoleAssignmentScheduleRequestImpl withExistingScope(String scope) { + this.scope = scope; + return this; + } + + public RoleAssignmentScheduleRequest create() { + this.innerObject = + serviceManager + .serviceClient() + .getRoleAssignmentScheduleRequests() + .createWithResponse(scope, roleAssignmentScheduleRequestName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public RoleAssignmentScheduleRequest create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRoleAssignmentScheduleRequests() + .createWithResponse(scope, roleAssignmentScheduleRequestName, this.innerModel(), context) + .getValue(); + return this; + } + + RoleAssignmentScheduleRequestImpl( + String name, com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerObject = new RoleAssignmentScheduleRequestInner(); + this.serviceManager = serviceManager; + this.roleAssignmentScheduleRequestName = name; + } + + public RoleAssignmentScheduleRequest refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getRoleAssignmentScheduleRequests() + .getWithResponse(scope, roleAssignmentScheduleRequestName, Context.NONE) + .getValue(); + return this; + } + + public RoleAssignmentScheduleRequest refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRoleAssignmentScheduleRequests() + .getWithResponse(scope, roleAssignmentScheduleRequestName, context) + .getValue(); + return this; + } + + public Response cancelWithResponse(Context context) { + return serviceManager + .roleAssignmentScheduleRequests() + .cancelWithResponse(scope, roleAssignmentScheduleRequestName, context); + } + + public void cancel() { + serviceManager.roleAssignmentScheduleRequests().cancel(scope, roleAssignmentScheduleRequestName); + } + + public Response validateWithResponse( + RoleAssignmentScheduleRequestInner parameters, Context context) { + return serviceManager + .roleAssignmentScheduleRequests() + .validateWithResponse(scope, roleAssignmentScheduleRequestName, parameters, context); + } + + public RoleAssignmentScheduleRequest validate(RoleAssignmentScheduleRequestInner parameters) { + return serviceManager + .roleAssignmentScheduleRequests() + .validate(scope, roleAssignmentScheduleRequestName, parameters); + } + + public RoleAssignmentScheduleRequestImpl withRoleDefinitionId(String roleDefinitionId) { + this.innerModel().withRoleDefinitionId(roleDefinitionId); + return this; + } + + public RoleAssignmentScheduleRequestImpl withPrincipalId(String principalId) { + this.innerModel().withPrincipalId(principalId); + return this; + } + + public RoleAssignmentScheduleRequestImpl withRequestType(RequestType requestType) { + this.innerModel().withRequestType(requestType); + return this; + } + + public RoleAssignmentScheduleRequestImpl withTargetRoleAssignmentScheduleId(String targetRoleAssignmentScheduleId) { + this.innerModel().withTargetRoleAssignmentScheduleId(targetRoleAssignmentScheduleId); + return this; + } + + public RoleAssignmentScheduleRequestImpl withTargetRoleAssignmentScheduleInstanceId( + String targetRoleAssignmentScheduleInstanceId) { + this.innerModel().withTargetRoleAssignmentScheduleInstanceId(targetRoleAssignmentScheduleInstanceId); + return this; + } + + public RoleAssignmentScheduleRequestImpl withScheduleInfo( + RoleAssignmentScheduleRequestPropertiesScheduleInfo scheduleInfo) { + this.innerModel().withScheduleInfo(scheduleInfo); + return this; + } + + public RoleAssignmentScheduleRequestImpl withLinkedRoleEligibilityScheduleId( + String linkedRoleEligibilityScheduleId) { + this.innerModel().withLinkedRoleEligibilityScheduleId(linkedRoleEligibilityScheduleId); + return this; + } + + public RoleAssignmentScheduleRequestImpl withJustification(String justification) { + this.innerModel().withJustification(justification); + return this; + } + + public RoleAssignmentScheduleRequestImpl withTicketInfo( + RoleAssignmentScheduleRequestPropertiesTicketInfo ticketInfo) { + this.innerModel().withTicketInfo(ticketInfo); + return this; + } + + public RoleAssignmentScheduleRequestImpl withCondition(String condition) { + this.innerModel().withCondition(condition); + return this; + } + + public RoleAssignmentScheduleRequestImpl withConditionVersion(String conditionVersion) { + this.innerModel().withConditionVersion(conditionVersion); + return this; + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleAssignmentScheduleRequestsClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleAssignmentScheduleRequestsClientImpl.java new file mode 100644 index 000000000000..e37f1f6ae944 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleAssignmentScheduleRequestsClientImpl.java @@ -0,0 +1,1013 @@ +// 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.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.RoleAssignmentScheduleRequestsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleAssignmentScheduleRequestInner; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignmentScheduleRequestListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RoleAssignmentScheduleRequestsClient. */ +public final class RoleAssignmentScheduleRequestsClientImpl implements RoleAssignmentScheduleRequestsClient { + /** The proxy service used to perform REST calls. */ + private final RoleAssignmentScheduleRequestsService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of RoleAssignmentScheduleRequestsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RoleAssignmentScheduleRequestsClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy + .create( + RoleAssignmentScheduleRequestsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AuthorizationManagementClientRoleAssignmentScheduleRequests to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + public interface RoleAssignmentScheduleRequestsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}") + @ExpectedResponses({201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam("roleAssignmentScheduleRequestName") String roleAssignmentScheduleRequestName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RoleAssignmentScheduleRequestInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam("roleAssignmentScheduleRequestName") String roleAssignmentScheduleRequestName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForScope( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @QueryParam("$filter") String filter, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}/cancel") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> cancel( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam("roleAssignmentScheduleRequestName") String roleAssignmentScheduleRequestName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}/validate") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> validate( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam("roleAssignmentScheduleRequestName") String roleAssignmentScheduleRequestName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RoleAssignmentScheduleRequestInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForScopeNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates a role assignment schedule request. + * + * @param scope The scope of the role assignment schedule request to create. The scope can be any REST resource + * instance. For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a + * subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param roleAssignmentScheduleRequestName A GUID for the role assignment to create. The name must be unique and + * different for each role assignment. + * @param parameters Parameters for the role assignment schedule request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role Assignment schedule request along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String scope, String roleAssignmentScheduleRequestName, RoleAssignmentScheduleRequestInner parameters) { + 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 (roleAssignmentScheduleRequestName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter roleAssignmentScheduleRequestName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2022-04-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + scope, + roleAssignmentScheduleRequestName, + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a role assignment schedule request. + * + * @param scope The scope of the role assignment schedule request to create. The scope can be any REST resource + * instance. For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a + * subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param roleAssignmentScheduleRequestName A GUID for the role assignment to create. The name must be unique and + * different for each role assignment. + * @param parameters Parameters for the role assignment schedule request. + * @param 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 role Assignment schedule request along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String scope, + String roleAssignmentScheduleRequestName, + RoleAssignmentScheduleRequestInner parameters, + 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 (roleAssignmentScheduleRequestName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter roleAssignmentScheduleRequestName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2022-04-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + scope, + roleAssignmentScheduleRequestName, + apiVersion, + parameters, + accept, + context); + } + + /** + * Creates a role assignment schedule request. + * + * @param scope The scope of the role assignment schedule request to create. The scope can be any REST resource + * instance. For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a + * subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param roleAssignmentScheduleRequestName A GUID for the role assignment to create. The name must be unique and + * different for each role assignment. + * @param parameters Parameters for the role assignment schedule request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role Assignment schedule request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String scope, String roleAssignmentScheduleRequestName, RoleAssignmentScheduleRequestInner parameters) { + return createWithResponseAsync(scope, roleAssignmentScheduleRequestName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates a role assignment schedule request. + * + * @param scope The scope of the role assignment schedule request to create. The scope can be any REST resource + * instance. For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a + * subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param roleAssignmentScheduleRequestName A GUID for the role assignment to create. The name must be unique and + * different for each role assignment. + * @param parameters Parameters for the role assignment schedule request. + * @param 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 role Assignment schedule request along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String scope, + String roleAssignmentScheduleRequestName, + RoleAssignmentScheduleRequestInner parameters, + Context context) { + return createWithResponseAsync(scope, roleAssignmentScheduleRequestName, parameters, context).block(); + } + + /** + * Creates a role assignment schedule request. + * + * @param scope The scope of the role assignment schedule request to create. The scope can be any REST resource + * instance. For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a + * subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param roleAssignmentScheduleRequestName A GUID for the role assignment to create. The name must be unique and + * different for each role assignment. + * @param parameters Parameters for the role assignment schedule request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role Assignment schedule request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoleAssignmentScheduleRequestInner create( + String scope, String roleAssignmentScheduleRequestName, RoleAssignmentScheduleRequestInner parameters) { + return createWithResponse(scope, roleAssignmentScheduleRequestName, parameters, Context.NONE).getValue(); + } + + /** + * Get the specified role assignment schedule request. + * + * @param scope The scope of the role assignment schedule request. + * @param roleAssignmentScheduleRequestName The name (guid) of the role assignment schedule request to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified role assignment schedule request along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String scope, String roleAssignmentScheduleRequestName) { + 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 (roleAssignmentScheduleRequestName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter roleAssignmentScheduleRequestName is required and cannot be null.")); + } + final String apiVersion = "2022-04-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + scope, + roleAssignmentScheduleRequestName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the specified role assignment schedule request. + * + * @param scope The scope of the role assignment schedule request. + * @param roleAssignmentScheduleRequestName The name (guid) of the role assignment schedule request to get. + * @param 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 specified role assignment schedule request along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String scope, String roleAssignmentScheduleRequestName, 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 (roleAssignmentScheduleRequestName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter roleAssignmentScheduleRequestName is required and cannot be null.")); + } + final String apiVersion = "2022-04-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get(this.client.getEndpoint(), scope, roleAssignmentScheduleRequestName, apiVersion, accept, context); + } + + /** + * Get the specified role assignment schedule request. + * + * @param scope The scope of the role assignment schedule request. + * @param roleAssignmentScheduleRequestName The name (guid) of the role assignment schedule request to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified role assignment schedule request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String scope, String roleAssignmentScheduleRequestName) { + return getWithResponseAsync(scope, roleAssignmentScheduleRequestName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the specified role assignment schedule request. + * + * @param scope The scope of the role assignment schedule request. + * @param roleAssignmentScheduleRequestName The name (guid) of the role assignment schedule request to get. + * @param 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 specified role assignment schedule request along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String scope, String roleAssignmentScheduleRequestName, Context context) { + return getWithResponseAsync(scope, roleAssignmentScheduleRequestName, context).block(); + } + + /** + * Get the specified role assignment schedule request. + * + * @param scope The scope of the role assignment schedule request. + * @param roleAssignmentScheduleRequestName The name (guid) of the role assignment schedule request to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified role assignment schedule request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoleAssignmentScheduleRequestInner get(String scope, String roleAssignmentScheduleRequestName) { + return getWithResponse(scope, roleAssignmentScheduleRequestName, Context.NONE).getValue(); + } + + /** + * Gets role assignment schedule requests for a scope. + * + * @param scope The scope of the role assignments schedule requests. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedule + * requests at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedule + * requests at, above or below the scope for the specified principal. Use $filter=asRequestor() to return all + * role assignment schedule requests requested by the current user. Use $filter=asTarget() to return all role + * assignment schedule requests created for the current user. Use $filter=asApprover() to return all role + * assignment schedule requests where the current user is an approver. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role assignment schedule requests for a scope along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeSinglePageAsync( + 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 apiVersion = "2022-04-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listForScope(this.client.getEndpoint(), scope, filter, apiVersion, 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())); + } + + /** + * Gets role assignment schedule requests for a scope. + * + * @param scope The scope of the role assignments schedule requests. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedule + * requests at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedule + * requests at, above or below the scope for the specified principal. Use $filter=asRequestor() to return all + * role assignment schedule requests requested by the current user. Use $filter=asTarget() to return all role + * assignment schedule requests created for the current user. Use $filter=asApprover() to return all role + * assignment schedule requests where the current user is an approver. + * @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 role assignment schedule requests for a scope along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeSinglePageAsync( + 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 apiVersion = "2022-04-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listForScope(this.client.getEndpoint(), scope, filter, apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets role assignment schedule requests for a scope. + * + * @param scope The scope of the role assignments schedule requests. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedule + * requests at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedule + * requests at, above or below the scope for the specified principal. Use $filter=asRequestor() to return all + * role assignment schedule requests requested by the current user. Use $filter=asTarget() to return all role + * assignment schedule requests created for the current user. Use $filter=asApprover() to return all role + * assignment schedule requests where the current user is an approver. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role assignment schedule requests for a scope as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForScopeAsync(String scope, String filter) { + return new PagedFlux<>( + () -> listForScopeSinglePageAsync(scope, filter), nextLink -> listForScopeNextSinglePageAsync(nextLink)); + } + + /** + * Gets role assignment schedule requests for a scope. + * + * @param scope The scope of the role assignments schedule requests. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role assignment schedule requests for a scope as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForScopeAsync(String scope) { + final String filter = null; + return new PagedFlux<>( + () -> listForScopeSinglePageAsync(scope, filter), nextLink -> listForScopeNextSinglePageAsync(nextLink)); + } + + /** + * Gets role assignment schedule requests for a scope. + * + * @param scope The scope of the role assignments schedule requests. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedule + * requests at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedule + * requests at, above or below the scope for the specified principal. Use $filter=asRequestor() to return all + * role assignment schedule requests requested by the current user. Use $filter=asTarget() to return all role + * assignment schedule requests created for the current user. Use $filter=asApprover() to return all role + * assignment schedule requests where the current user is an approver. + * @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 role assignment schedule requests for a scope as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForScopeAsync( + String scope, String filter, Context context) { + return new PagedFlux<>( + () -> listForScopeSinglePageAsync(scope, filter, context), + nextLink -> listForScopeNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets role assignment schedule requests for a scope. + * + * @param scope The scope of the role assignments schedule requests. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role assignment schedule requests for a scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForScope(String scope) { + final String filter = null; + return new PagedIterable<>(listForScopeAsync(scope, filter)); + } + + /** + * Gets role assignment schedule requests for a scope. + * + * @param scope The scope of the role assignments schedule requests. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedule + * requests at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedule + * requests at, above or below the scope for the specified principal. Use $filter=asRequestor() to return all + * role assignment schedule requests requested by the current user. Use $filter=asTarget() to return all role + * assignment schedule requests created for the current user. Use $filter=asApprover() to return all role + * assignment schedule requests where the current user is an approver. + * @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 role assignment schedule requests for a scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForScope( + String scope, String filter, Context context) { + return new PagedIterable<>(listForScopeAsync(scope, filter, context)); + } + + /** + * Cancels a pending role assignment schedule request. + * + * @param scope The scope of the role assignment request to cancel. + * @param roleAssignmentScheduleRequestName The name of the role assignment request to cancel. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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> cancelWithResponseAsync(String scope, String roleAssignmentScheduleRequestName) { + 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 (roleAssignmentScheduleRequestName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter roleAssignmentScheduleRequestName is required and cannot be null.")); + } + final String apiVersion = "2022-04-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .cancel( + this.client.getEndpoint(), + scope, + roleAssignmentScheduleRequestName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Cancels a pending role assignment schedule request. + * + * @param scope The scope of the role assignment request to cancel. + * @param roleAssignmentScheduleRequestName The name of the role assignment request to cancel. + * @param 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> cancelWithResponseAsync( + String scope, String roleAssignmentScheduleRequestName, 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 (roleAssignmentScheduleRequestName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter roleAssignmentScheduleRequestName is required and cannot be null.")); + } + final String apiVersion = "2022-04-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .cancel(this.client.getEndpoint(), scope, roleAssignmentScheduleRequestName, apiVersion, accept, context); + } + + /** + * Cancels a pending role assignment schedule request. + * + * @param scope The scope of the role assignment request to cancel. + * @param roleAssignmentScheduleRequestName The name of the role assignment request to cancel. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cancelAsync(String scope, String roleAssignmentScheduleRequestName) { + return cancelWithResponseAsync(scope, roleAssignmentScheduleRequestName).flatMap(ignored -> Mono.empty()); + } + + /** + * Cancels a pending role assignment schedule request. + * + * @param scope The scope of the role assignment request to cancel. + * @param roleAssignmentScheduleRequestName The name of the role assignment request to cancel. + * @param 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 cancelWithResponse(String scope, String roleAssignmentScheduleRequestName, Context context) { + return cancelWithResponseAsync(scope, roleAssignmentScheduleRequestName, context).block(); + } + + /** + * Cancels a pending role assignment schedule request. + * + * @param scope The scope of the role assignment request to cancel. + * @param roleAssignmentScheduleRequestName The name of the role assignment request to cancel. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 cancel(String scope, String roleAssignmentScheduleRequestName) { + cancelWithResponse(scope, roleAssignmentScheduleRequestName, Context.NONE); + } + + /** + * Validates a new role assignment schedule request. + * + * @param scope The scope of the role assignment request to validate. + * @param roleAssignmentScheduleRequestName The name of the role assignment request to validate. + * @param parameters Parameters for the role assignment schedule request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role Assignment schedule request along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateWithResponseAsync( + String scope, String roleAssignmentScheduleRequestName, RoleAssignmentScheduleRequestInner parameters) { + 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 (roleAssignmentScheduleRequestName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter roleAssignmentScheduleRequestName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2022-04-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .validate( + this.client.getEndpoint(), + scope, + roleAssignmentScheduleRequestName, + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Validates a new role assignment schedule request. + * + * @param scope The scope of the role assignment request to validate. + * @param roleAssignmentScheduleRequestName The name of the role assignment request to validate. + * @param parameters Parameters for the role assignment schedule request. + * @param 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 role Assignment schedule request along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateWithResponseAsync( + String scope, + String roleAssignmentScheduleRequestName, + RoleAssignmentScheduleRequestInner parameters, + 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 (roleAssignmentScheduleRequestName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter roleAssignmentScheduleRequestName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2022-04-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .validate( + this.client.getEndpoint(), + scope, + roleAssignmentScheduleRequestName, + apiVersion, + parameters, + accept, + context); + } + + /** + * Validates a new role assignment schedule request. + * + * @param scope The scope of the role assignment request to validate. + * @param roleAssignmentScheduleRequestName The name of the role assignment request to validate. + * @param parameters Parameters for the role assignment schedule request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role Assignment schedule request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateAsync( + String scope, String roleAssignmentScheduleRequestName, RoleAssignmentScheduleRequestInner parameters) { + return validateWithResponseAsync(scope, roleAssignmentScheduleRequestName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Validates a new role assignment schedule request. + * + * @param scope The scope of the role assignment request to validate. + * @param roleAssignmentScheduleRequestName The name of the role assignment request to validate. + * @param parameters Parameters for the role assignment schedule request. + * @param 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 role Assignment schedule request along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response validateWithResponse( + String scope, + String roleAssignmentScheduleRequestName, + RoleAssignmentScheduleRequestInner parameters, + Context context) { + return validateWithResponseAsync(scope, roleAssignmentScheduleRequestName, parameters, context).block(); + } + + /** + * Validates a new role assignment schedule request. + * + * @param scope The scope of the role assignment request to validate. + * @param roleAssignmentScheduleRequestName The name of the role assignment request to validate. + * @param parameters Parameters for the role assignment schedule request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role Assignment schedule request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoleAssignmentScheduleRequestInner validate( + String scope, String roleAssignmentScheduleRequestName, RoleAssignmentScheduleRequestInner parameters) { + return validateWithResponse(scope, roleAssignmentScheduleRequestName, parameters, Context.NONE).getValue(); + } + + /** + * 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 role assignment schedule request list operation result along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeNextSinglePageAsync(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.listForScopeNext(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 role assignment schedule request list operation result along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeNextSinglePageAsync( + 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 + .listForScopeNext(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/RoleAssignmentScheduleRequestsImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleAssignmentScheduleRequestsImpl.java new file mode 100644 index 000000000000..0d1df2a790c3 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleAssignmentScheduleRequestsImpl.java @@ -0,0 +1,178 @@ +// 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.RoleAssignmentScheduleRequestsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleAssignmentScheduleRequestInner; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignmentScheduleRequest; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignmentScheduleRequests; + +public final class RoleAssignmentScheduleRequestsImpl implements RoleAssignmentScheduleRequests { + private static final ClientLogger LOGGER = new ClientLogger(RoleAssignmentScheduleRequestsImpl.class); + + private final RoleAssignmentScheduleRequestsClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public RoleAssignmentScheduleRequestsImpl( + RoleAssignmentScheduleRequestsClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String scope, String roleAssignmentScheduleRequestName, Context context) { + Response inner = + this.serviceClient().getWithResponse(scope, roleAssignmentScheduleRequestName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RoleAssignmentScheduleRequestImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RoleAssignmentScheduleRequest get(String scope, String roleAssignmentScheduleRequestName) { + RoleAssignmentScheduleRequestInner inner = this.serviceClient().get(scope, roleAssignmentScheduleRequestName); + if (inner != null) { + return new RoleAssignmentScheduleRequestImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listForScope(String scope) { + PagedIterable inner = this.serviceClient().listForScope(scope); + return Utils.mapPage(inner, inner1 -> new RoleAssignmentScheduleRequestImpl(inner1, this.manager())); + } + + public PagedIterable listForScope(String scope, String filter, Context context) { + PagedIterable inner = + this.serviceClient().listForScope(scope, filter, context); + return Utils.mapPage(inner, inner1 -> new RoleAssignmentScheduleRequestImpl(inner1, this.manager())); + } + + public Response cancelWithResponse(String scope, String roleAssignmentScheduleRequestName, Context context) { + return this.serviceClient().cancelWithResponse(scope, roleAssignmentScheduleRequestName, context); + } + + public void cancel(String scope, String roleAssignmentScheduleRequestName) { + this.serviceClient().cancel(scope, roleAssignmentScheduleRequestName); + } + + public Response validateWithResponse( + String scope, + String roleAssignmentScheduleRequestName, + RoleAssignmentScheduleRequestInner parameters, + Context context) { + Response inner = + this.serviceClient().validateWithResponse(scope, roleAssignmentScheduleRequestName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RoleAssignmentScheduleRequestImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RoleAssignmentScheduleRequest validate( + String scope, String roleAssignmentScheduleRequestName, RoleAssignmentScheduleRequestInner parameters) { + RoleAssignmentScheduleRequestInner inner = + this.serviceClient().validate(scope, roleAssignmentScheduleRequestName, parameters); + if (inner != null) { + return new RoleAssignmentScheduleRequestImpl(inner, this.manager()); + } else { + return null; + } + } + + public RoleAssignmentScheduleRequest getById(String id) { + String scope = + Utils + .getValueFromIdByParameterName( + id, + "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}", + "scope"); + if (scope == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); + } + String roleAssignmentScheduleRequestName = + Utils + .getValueFromIdByParameterName( + id, + "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}", + "roleAssignmentScheduleRequestName"); + if (roleAssignmentScheduleRequestName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'roleAssignmentScheduleRequests'.", + id))); + } + return this.getWithResponse(scope, roleAssignmentScheduleRequestName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String scope = + Utils + .getValueFromIdByParameterName( + id, + "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}", + "scope"); + if (scope == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); + } + String roleAssignmentScheduleRequestName = + Utils + .getValueFromIdByParameterName( + id, + "/{scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{roleAssignmentScheduleRequestName}", + "roleAssignmentScheduleRequestName"); + if (roleAssignmentScheduleRequestName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'roleAssignmentScheduleRequests'.", + id))); + } + return this.getWithResponse(scope, roleAssignmentScheduleRequestName, context); + } + + private RoleAssignmentScheduleRequestsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } + + public RoleAssignmentScheduleRequestImpl define(String name) { + return new RoleAssignmentScheduleRequestImpl(name, this.manager()); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleAssignmentSchedulesClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleAssignmentSchedulesClientImpl.java new file mode 100644 index 000000000000..f8279453eb88 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleAssignmentSchedulesClientImpl.java @@ -0,0 +1,472 @@ +// 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.RoleAssignmentSchedulesClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleAssignmentScheduleInner; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignmentScheduleListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RoleAssignmentSchedulesClient. */ +public final class RoleAssignmentSchedulesClientImpl implements RoleAssignmentSchedulesClient { + /** The proxy service used to perform REST calls. */ + private final RoleAssignmentSchedulesService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of RoleAssignmentSchedulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RoleAssignmentSchedulesClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy + .create(RoleAssignmentSchedulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AuthorizationManagementClientRoleAssignmentSchedules to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + public interface RoleAssignmentSchedulesService { + @Headers({"Content-Type: application/json"}) + @Get("/{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules/{roleAssignmentScheduleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam("roleAssignmentScheduleName") String roleAssignmentScheduleName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/{scope}/providers/Microsoft.Authorization/roleAssignmentSchedules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForScope( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @QueryParam("$filter") String filter, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForScopeNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the specified role assignment schedule for a resource scope. + * + * @param scope The scope of the role assignment schedule. + * @param roleAssignmentScheduleName The name (guid) of the role assignment schedule to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified role assignment schedule for a resource scope along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String scope, String roleAssignmentScheduleName) { + 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 (roleAssignmentScheduleName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter roleAssignmentScheduleName is required and cannot be null.")); + } + final String apiVersion = "2020-10-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get(this.client.getEndpoint(), scope, roleAssignmentScheduleName, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the specified role assignment schedule for a resource scope. + * + * @param scope The scope of the role assignment schedule. + * @param roleAssignmentScheduleName The name (guid) of the role assignment schedule to get. + * @param 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 specified role assignment schedule for a resource scope along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String scope, String roleAssignmentScheduleName, 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 (roleAssignmentScheduleName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter roleAssignmentScheduleName is required and cannot be null.")); + } + final String apiVersion = "2020-10-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), scope, roleAssignmentScheduleName, apiVersion, accept, context); + } + + /** + * Get the specified role assignment schedule for a resource scope. + * + * @param scope The scope of the role assignment schedule. + * @param roleAssignmentScheduleName The name (guid) of the role assignment schedule to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified role assignment schedule for a resource scope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String scope, String roleAssignmentScheduleName) { + return getWithResponseAsync(scope, roleAssignmentScheduleName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the specified role assignment schedule for a resource scope. + * + * @param scope The scope of the role assignment schedule. + * @param roleAssignmentScheduleName The name (guid) of the role assignment schedule to get. + * @param 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 specified role assignment schedule for a resource scope along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String scope, String roleAssignmentScheduleName, Context context) { + return getWithResponseAsync(scope, roleAssignmentScheduleName, context).block(); + } + + /** + * Get the specified role assignment schedule for a resource scope. + * + * @param scope The scope of the role assignment schedule. + * @param roleAssignmentScheduleName The name (guid) of the role assignment schedule to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified role assignment schedule for a resource scope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoleAssignmentScheduleInner get(String scope, String roleAssignmentScheduleName) { + return getWithResponse(scope, roleAssignmentScheduleName, Context.NONE).getValue(); + } + + /** + * Gets role assignment schedules for a resource scope. + * + * @param scope The scope of the role assignments schedules. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + * at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or + * below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment + * schedules for the current user. Use $filter=asTarget() to return all role assignment schedules created for + * the current user. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role assignment schedules for a resource scope along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeSinglePageAsync(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 apiVersion = "2020-10-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listForScope(this.client.getEndpoint(), scope, filter, apiVersion, 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())); + } + + /** + * Gets role assignment schedules for a resource scope. + * + * @param scope The scope of the role assignments schedules. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + * at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or + * below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment + * schedules for the current user. Use $filter=asTarget() to return all role assignment schedules created for + * the current user. + * @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 role assignment schedules for a resource scope along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeSinglePageAsync( + 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 apiVersion = "2020-10-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listForScope(this.client.getEndpoint(), scope, filter, apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets role assignment schedules for a resource scope. + * + * @param scope The scope of the role assignments schedules. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + * at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or + * below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment + * schedules for the current user. Use $filter=asTarget() to return all role assignment schedules created for + * the current user. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role assignment schedules for a resource scope as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForScopeAsync(String scope, String filter) { + return new PagedFlux<>( + () -> listForScopeSinglePageAsync(scope, filter), nextLink -> listForScopeNextSinglePageAsync(nextLink)); + } + + /** + * Gets role assignment schedules for a resource scope. + * + * @param scope The scope of the role assignments schedules. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role assignment schedules for a resource scope as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForScopeAsync(String scope) { + final String filter = null; + return new PagedFlux<>( + () -> listForScopeSinglePageAsync(scope, filter), nextLink -> listForScopeNextSinglePageAsync(nextLink)); + } + + /** + * Gets role assignment schedules for a resource scope. + * + * @param scope The scope of the role assignments schedules. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + * at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or + * below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment + * schedules for the current user. Use $filter=asTarget() to return all role assignment schedules created for + * the current user. + * @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 role assignment schedules for a resource scope as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForScopeAsync(String scope, String filter, Context context) { + return new PagedFlux<>( + () -> listForScopeSinglePageAsync(scope, filter, context), + nextLink -> listForScopeNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets role assignment schedules for a resource scope. + * + * @param scope The scope of the role assignments schedules. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role assignment schedules for a resource scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForScope(String scope) { + final String filter = null; + return new PagedIterable<>(listForScopeAsync(scope, filter)); + } + + /** + * Gets role assignment schedules for a resource scope. + * + * @param scope The scope of the role assignments schedules. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + * at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or + * below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment + * schedules for the current user. Use $filter=asTarget() to return all role assignment schedules created for + * the current user. + * @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 role assignment schedules for a resource scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForScope(String scope, String filter, Context context) { + return new PagedIterable<>(listForScopeAsync(scope, 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 role assignment schedule list operation result along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeNextSinglePageAsync(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.listForScopeNext(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 role assignment schedule list operation result along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeNextSinglePageAsync( + 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 + .listForScopeNext(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/RoleAssignmentSchedulesImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleAssignmentSchedulesImpl.java new file mode 100644 index 000000000000..208d2be0e6b2 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleAssignmentSchedulesImpl.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.RoleAssignmentSchedulesClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleAssignmentScheduleInner; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignmentSchedule; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignmentSchedules; + +public final class RoleAssignmentSchedulesImpl implements RoleAssignmentSchedules { + private static final ClientLogger LOGGER = new ClientLogger(RoleAssignmentSchedulesImpl.class); + + private final RoleAssignmentSchedulesClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public RoleAssignmentSchedulesImpl( + RoleAssignmentSchedulesClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String scope, String roleAssignmentScheduleName, Context context) { + Response inner = + this.serviceClient().getWithResponse(scope, roleAssignmentScheduleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RoleAssignmentScheduleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RoleAssignmentSchedule get(String scope, String roleAssignmentScheduleName) { + RoleAssignmentScheduleInner inner = this.serviceClient().get(scope, roleAssignmentScheduleName); + if (inner != null) { + return new RoleAssignmentScheduleImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listForScope(String scope) { + PagedIterable inner = this.serviceClient().listForScope(scope); + return Utils.mapPage(inner, inner1 -> new RoleAssignmentScheduleImpl(inner1, this.manager())); + } + + public PagedIterable listForScope(String scope, String filter, Context context) { + PagedIterable inner = this.serviceClient().listForScope(scope, filter, context); + return Utils.mapPage(inner, inner1 -> new RoleAssignmentScheduleImpl(inner1, this.manager())); + } + + private RoleAssignmentSchedulesClient 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/RoleAssignmentsClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleAssignmentsClientImpl.java new file mode 100644 index 000000000000..e42e3390f3df --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleAssignmentsClientImpl.java @@ -0,0 +1,2317 @@ +// 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.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.RoleAssignmentsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleAssignmentInner; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignmentCreateParameters; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignmentListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RoleAssignmentsClient. */ +public final class RoleAssignmentsClientImpl implements RoleAssignmentsClient { + /** The proxy service used to perform REST calls. */ + private final RoleAssignmentsService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of RoleAssignmentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RoleAssignmentsClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy.create(RoleAssignmentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AuthorizationManagementClientRoleAssignments to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + public interface RoleAssignmentsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/roleAssignments") + @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, + @QueryParam("tenantId") String tenantId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/roleAssignments") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @QueryParam(value = "$filter", encoded = true) String filter, + @QueryParam("tenantId") String tenantId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/roleAssignments") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForResource( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam(value = "resourceProviderNamespace", encoded = true) String resourceProviderNamespace, + @PathParam(value = "resourceType", encoded = true) String resourceType, + @PathParam(value = "resourceName", encoded = true) String resourceName, + @QueryParam("api-version") String apiVersion, + @QueryParam(value = "$filter", encoded = true) String filter, + @QueryParam("tenantId") String tenantId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam(value = "roleAssignmentName", encoded = true) String roleAssignmentName, + @QueryParam("api-version") String apiVersion, + @QueryParam("tenantId") String tenantId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put("/{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam(value = "roleAssignmentName", encoded = true) String roleAssignmentName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RoleAssignmentCreateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete("/{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam(value = "roleAssignmentName", encoded = true) String roleAssignmentName, + @QueryParam("api-version") String apiVersion, + @QueryParam("tenantId") String tenantId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/{scope}/providers/Microsoft.Authorization/roleAssignments") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForScope( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @QueryParam(value = "$filter", encoded = true) String filter, + @QueryParam("api-version") String apiVersion, + @QueryParam("tenantId") String tenantId, + @QueryParam(value = "$skipToken", encoded = true) String skipToken, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/{roleAssignmentId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getById( + @HostParam("$host") String endpoint, + @PathParam(value = "roleAssignmentId", encoded = true) String roleAssignmentId, + @QueryParam("api-version") String apiVersion, + @QueryParam("tenantId") String tenantId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put("/{roleAssignmentId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createById( + @HostParam("$host") String endpoint, + @PathParam(value = "roleAssignmentId", encoded = true) String roleAssignmentId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RoleAssignmentCreateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete("/{roleAssignmentId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> deleteById( + @HostParam("$host") String endpoint, + @PathParam(value = "roleAssignmentId", encoded = true) String roleAssignmentId, + @QueryParam("api-version") String apiVersion, + @QueryParam("tenantId") String tenantId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForSubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForResourceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForScopeNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List all role assignments that apply to a subscription. + * + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or + * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope + * for the specified principal. + * @param tenantId Tenant ID for cross-tenant request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role assignment list operation result along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String filter, String tenantId) { + 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 apiVersion = "2022-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + filter, + tenantId, + 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())); + } + + /** + * List all role assignments that apply to a subscription. + * + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or + * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope + * for the specified principal. + * @param tenantId Tenant ID for cross-tenant request. + * @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 role assignment list operation result along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String filter, String tenantId, 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 apiVersion = "2022-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + apiVersion, + filter, + tenantId, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all role assignments that apply to a subscription. + * + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or + * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope + * for the specified principal. + * @param tenantId Tenant ID for cross-tenant request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role assignment list operation result as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter, String tenantId) { + return new PagedFlux<>( + () -> listSinglePageAsync(filter, tenantId), nextLink -> listForSubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List all role assignments that apply to a 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 role assignment list operation result as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String filter = null; + final String tenantId = null; + return new PagedFlux<>( + () -> listSinglePageAsync(filter, tenantId), nextLink -> listForSubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List all role assignments that apply to a subscription. + * + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or + * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope + * for the specified principal. + * @param tenantId Tenant ID for cross-tenant request. + * @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 role assignment list operation result as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter, String tenantId, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(filter, tenantId, context), + nextLink -> listForSubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List all role assignments that apply to a 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 role assignment list operation result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String filter = null; + final String tenantId = null; + return new PagedIterable<>(listAsync(filter, tenantId)); + } + + /** + * List all role assignments that apply to a subscription. + * + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or + * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope + * for the specified principal. + * @param tenantId Tenant ID for cross-tenant request. + * @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 role assignment list operation result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String filter, String tenantId, Context context) { + return new PagedIterable<>(listAsync(filter, tenantId, context)); + } + + /** + * List all role assignments that apply to a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or + * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope + * for the specified principal. + * @param tenantId Tenant ID for cross-tenant request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role assignment list operation result along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, String filter, String tenantId) { + 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2022-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + filter, + tenantId, + 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())); + } + + /** + * List all role assignments that apply to a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or + * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope + * for the specified principal. + * @param tenantId Tenant ID for cross-tenant request. + * @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 role assignment list operation result along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, String filter, String tenantId, 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2022-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + apiVersion, + filter, + tenantId, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all role assignments that apply to a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or + * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope + * for the specified principal. + * @param tenantId Tenant ID for cross-tenant request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role assignment list operation result as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, String filter, String tenantId) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, tenantId), + nextLink -> listForResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List all role assignments that apply to a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role assignment list operation result as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final String filter = null; + final String tenantId = null; + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, tenantId), + nextLink -> listForResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List all role assignments that apply to a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or + * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope + * for the specified principal. + * @param tenantId Tenant ID for cross-tenant request. + * @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 role assignment list operation result as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, String filter, String tenantId, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, tenantId, context), + nextLink -> listForResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List all role assignments that apply to a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role assignment list operation result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final String filter = null; + final String tenantId = null; + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, tenantId)); + } + + /** + * List all role assignments that apply to a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or + * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope + * for the specified principal. + * @param tenantId Tenant ID for cross-tenant request. + * @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 role assignment list operation result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, String filter, String tenantId, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, tenantId, context)); + } + + /** + * List all role assignments that apply to a resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from + * Microsoft.Web/sites). + * @param resourceName The resource name. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or + * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope + * for the specified principal. + * @param tenantId Tenant ID for cross-tenant request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role assignment list operation result along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForResourceSinglePageAsync( + String resourceGroupName, + String resourceProviderNamespace, + String resourceType, + String resourceName, + String filter, + String tenantId) { + 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceProviderNamespace == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter resourceProviderNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2022-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listForResource( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceProviderNamespace, + resourceType, + resourceName, + apiVersion, + filter, + tenantId, + 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())); + } + + /** + * List all role assignments that apply to a resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from + * Microsoft.Web/sites). + * @param resourceName The resource name. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or + * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope + * for the specified principal. + * @param tenantId Tenant ID for cross-tenant request. + * @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 role assignment list operation result along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForResourceSinglePageAsync( + String resourceGroupName, + String resourceProviderNamespace, + String resourceType, + String resourceName, + String filter, + String tenantId, + 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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceProviderNamespace == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter resourceProviderNamespace is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2022-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listForResource( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceProviderNamespace, + resourceType, + resourceName, + apiVersion, + filter, + tenantId, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all role assignments that apply to a resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from + * Microsoft.Web/sites). + * @param resourceName The resource name. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or + * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope + * for the specified principal. + * @param tenantId Tenant ID for cross-tenant request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role assignment list operation result as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForResourceAsync( + String resourceGroupName, + String resourceProviderNamespace, + String resourceType, + String resourceName, + String filter, + String tenantId) { + return new PagedFlux<>( + () -> + listForResourceSinglePageAsync( + resourceGroupName, resourceProviderNamespace, resourceType, resourceName, filter, tenantId), + nextLink -> listForResourceNextSinglePageAsync(nextLink)); + } + + /** + * List all role assignments that apply to a resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from + * Microsoft.Web/sites). + * @param resourceName The resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role assignment list operation result as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForResourceAsync( + String resourceGroupName, String resourceProviderNamespace, String resourceType, String resourceName) { + final String filter = null; + final String tenantId = null; + return new PagedFlux<>( + () -> + listForResourceSinglePageAsync( + resourceGroupName, resourceProviderNamespace, resourceType, resourceName, filter, tenantId), + nextLink -> listForResourceNextSinglePageAsync(nextLink)); + } + + /** + * List all role assignments that apply to a resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from + * Microsoft.Web/sites). + * @param resourceName The resource name. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or + * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope + * for the specified principal. + * @param tenantId Tenant ID for cross-tenant request. + * @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 role assignment list operation result as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForResourceAsync( + String resourceGroupName, + String resourceProviderNamespace, + String resourceType, + String resourceName, + String filter, + String tenantId, + Context context) { + return new PagedFlux<>( + () -> + listForResourceSinglePageAsync( + resourceGroupName, + resourceProviderNamespace, + resourceType, + resourceName, + filter, + tenantId, + context), + nextLink -> listForResourceNextSinglePageAsync(nextLink, context)); + } + + /** + * List all role assignments that apply to a resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from + * Microsoft.Web/sites). + * @param resourceName The resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role assignment list operation result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForResource( + String resourceGroupName, String resourceProviderNamespace, String resourceType, String resourceName) { + final String filter = null; + final String tenantId = null; + return new PagedIterable<>( + listForResourceAsync( + resourceGroupName, resourceProviderNamespace, resourceType, resourceName, filter, tenantId)); + } + + /** + * List all role assignments that apply to a resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from + * Microsoft.Web/sites). + * @param resourceName The resource name. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or + * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope + * for the specified principal. + * @param tenantId Tenant ID for cross-tenant request. + * @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 role assignment list operation result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForResource( + String resourceGroupName, + String resourceProviderNamespace, + String resourceType, + String resourceName, + String filter, + String tenantId, + Context context) { + return new PagedIterable<>( + listForResourceAsync( + resourceGroupName, resourceProviderNamespace, resourceType, resourceName, filter, tenantId, context)); + } + + /** + * Get a role assignment by scope and name. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. + * @param tenantId Tenant ID for cross-tenant request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 role assignment by scope and name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String scope, String roleAssignmentName, String tenantId) { + 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 (roleAssignmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleAssignmentName is required and cannot be null.")); + } + final String apiVersion = "2022-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + scope, + roleAssignmentName, + apiVersion, + tenantId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a role assignment by scope and name. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. + * @param tenantId Tenant ID for cross-tenant request. + * @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 a role assignment by scope and name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String scope, String roleAssignmentName, String tenantId, 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 (roleAssignmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleAssignmentName is required and cannot be null.")); + } + final String apiVersion = "2022-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), scope, roleAssignmentName, apiVersion, tenantId, accept, context); + } + + /** + * Get a role assignment by scope and name. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 role assignment by scope and name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String scope, String roleAssignmentName) { + final String tenantId = null; + return getWithResponseAsync(scope, roleAssignmentName, tenantId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a role assignment by scope and name. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. + * @param tenantId Tenant ID for cross-tenant request. + * @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 a role assignment by scope and name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String scope, String roleAssignmentName, String tenantId, Context context) { + return getWithResponseAsync(scope, roleAssignmentName, tenantId, context).block(); + } + + /** + * Get a role assignment by scope and name. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 role assignment by scope and name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoleAssignmentInner get(String scope, String roleAssignmentName) { + final String tenantId = null; + return getWithResponse(scope, roleAssignmentName, tenantId, Context.NONE).getValue(); + } + + /** + * Create or update a role assignment by scope and name. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. + * @param parameters Parameters for the role assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role Assignments along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String scope, String roleAssignmentName, RoleAssignmentCreateParameters parameters) { + 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 (roleAssignmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleAssignmentName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2022-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + scope, + roleAssignmentName, + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a role assignment by scope and name. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. + * @param parameters Parameters for the role assignment. + * @param 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 role Assignments along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String scope, String roleAssignmentName, RoleAssignmentCreateParameters parameters, 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 (roleAssignmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleAssignmentName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2022-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create(this.client.getEndpoint(), scope, roleAssignmentName, apiVersion, parameters, accept, context); + } + + /** + * Create or update a role assignment by scope and name. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. + * @param parameters Parameters for the role assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role Assignments on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String scope, String roleAssignmentName, RoleAssignmentCreateParameters parameters) { + return createWithResponseAsync(scope, roleAssignmentName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create or update a role assignment by scope and name. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. + * @param parameters Parameters for the role assignment. + * @param 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 role Assignments along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String scope, String roleAssignmentName, RoleAssignmentCreateParameters parameters, Context context) { + return createWithResponseAsync(scope, roleAssignmentName, parameters, context).block(); + } + + /** + * Create or update a role assignment by scope and name. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. + * @param parameters Parameters for the role assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role Assignments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoleAssignmentInner create( + String scope, String roleAssignmentName, RoleAssignmentCreateParameters parameters) { + return createWithResponse(scope, roleAssignmentName, parameters, Context.NONE).getValue(); + } + + /** + * Delete a role assignment by scope and name. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. + * @param tenantId Tenant ID for cross-tenant request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role Assignments along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String scope, String roleAssignmentName, String tenantId) { + 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 (roleAssignmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleAssignmentName is required and cannot be null.")); + } + final String apiVersion = "2022-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + scope, + roleAssignmentName, + apiVersion, + tenantId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a role assignment by scope and name. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. + * @param tenantId Tenant ID for cross-tenant request. + * @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 role Assignments along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String scope, String roleAssignmentName, String tenantId, 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 (roleAssignmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleAssignmentName is required and cannot be null.")); + } + final String apiVersion = "2022-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete(this.client.getEndpoint(), scope, roleAssignmentName, apiVersion, tenantId, accept, context); + } + + /** + * Delete a role assignment by scope and name. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role Assignments on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String scope, String roleAssignmentName) { + final String tenantId = null; + return deleteWithResponseAsync(scope, roleAssignmentName, tenantId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Delete a role assignment by scope and name. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. + * @param tenantId Tenant ID for cross-tenant request. + * @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 role Assignments along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String scope, String roleAssignmentName, String tenantId, Context context) { + return deleteWithResponseAsync(scope, roleAssignmentName, tenantId, context).block(); + } + + /** + * Delete a role assignment by scope and name. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role Assignments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoleAssignmentInner delete(String scope, String roleAssignmentName) { + final String tenantId = null; + return deleteWithResponse(scope, roleAssignmentName, tenantId, Context.NONE).getValue(); + } + + /** + * List all role assignments that apply to a scope. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or + * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope + * for the specified principal. + * @param tenantId Tenant ID for cross-tenant request. + * @param skipToken The skipToken to apply on the operation. Use $skipToken={skiptoken} to return paged role + * assignments following the skipToken passed. Only supported on provider level calls. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role assignment list operation result along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeSinglePageAsync( + String scope, String filter, String tenantId, String skipToken) { + 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 apiVersion = "2022-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listForScope( + this.client.getEndpoint(), scope, filter, apiVersion, tenantId, skipToken, 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())); + } + + /** + * List all role assignments that apply to a scope. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or + * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope + * for the specified principal. + * @param tenantId Tenant ID for cross-tenant request. + * @param skipToken The skipToken to apply on the operation. Use $skipToken={skiptoken} to return paged role + * assignments following the skipToken passed. Only supported on provider level calls. + * @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 role assignment list operation result along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeSinglePageAsync( + String scope, String filter, String tenantId, String skipToken, 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 apiVersion = "2022-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listForScope(this.client.getEndpoint(), scope, filter, apiVersion, tenantId, skipToken, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all role assignments that apply to a scope. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or + * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope + * for the specified principal. + * @param tenantId Tenant ID for cross-tenant request. + * @param skipToken The skipToken to apply on the operation. Use $skipToken={skiptoken} to return paged role + * assignments following the skipToken passed. Only supported on provider level calls. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role assignment list operation result as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForScopeAsync( + String scope, String filter, String tenantId, String skipToken) { + return new PagedFlux<>( + () -> listForScopeSinglePageAsync(scope, filter, tenantId, skipToken), + nextLink -> listForScopeNextSinglePageAsync(nextLink)); + } + + /** + * List all role assignments that apply to a scope. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role assignment list operation result as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForScopeAsync(String scope) { + final String filter = null; + final String tenantId = null; + final String skipToken = null; + return new PagedFlux<>( + () -> listForScopeSinglePageAsync(scope, filter, tenantId, skipToken), + nextLink -> listForScopeNextSinglePageAsync(nextLink)); + } + + /** + * List all role assignments that apply to a scope. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or + * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope + * for the specified principal. + * @param tenantId Tenant ID for cross-tenant request. + * @param skipToken The skipToken to apply on the operation. Use $skipToken={skiptoken} to return paged role + * assignments following the skipToken passed. Only supported on provider level calls. + * @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 role assignment list operation result as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForScopeAsync( + String scope, String filter, String tenantId, String skipToken, Context context) { + return new PagedFlux<>( + () -> listForScopeSinglePageAsync(scope, filter, tenantId, skipToken, context), + nextLink -> listForScopeNextSinglePageAsync(nextLink, context)); + } + + /** + * List all role assignments that apply to a scope. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role assignment list operation result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForScope(String scope) { + final String filter = null; + final String tenantId = null; + final String skipToken = null; + return new PagedIterable<>(listForScopeAsync(scope, filter, tenantId, skipToken)); + } + + /** + * List all role assignments that apply to a scope. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or + * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope + * for the specified principal. + * @param tenantId Tenant ID for cross-tenant request. + * @param skipToken The skipToken to apply on the operation. Use $skipToken={skiptoken} to return paged role + * assignments following the skipToken passed. Only supported on provider level calls. + * @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 role assignment list operation result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForScope( + String scope, String filter, String tenantId, String skipToken, Context context) { + return new PagedIterable<>(listForScopeAsync(scope, filter, tenantId, skipToken, context)); + } + + /** + * Get a role assignment by ID. + * + * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource name, and + * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + * Example: + * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. + * @param tenantId Tenant ID for cross-tenant request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 role assignment by ID along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByIdWithResponseAsync(String roleAssignmentId, String tenantId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleAssignmentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null.")); + } + final String apiVersion = "2022-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service.getById(this.client.getEndpoint(), roleAssignmentId, apiVersion, tenantId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a role assignment by ID. + * + * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource name, and + * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + * Example: + * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. + * @param tenantId Tenant ID for cross-tenant request. + * @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 a role assignment by ID along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByIdWithResponseAsync( + String roleAssignmentId, String tenantId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleAssignmentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null.")); + } + final String apiVersion = "2022-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getById(this.client.getEndpoint(), roleAssignmentId, apiVersion, tenantId, accept, context); + } + + /** + * Get a role assignment by ID. + * + * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource name, and + * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + * Example: + * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 role assignment by ID on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByIdAsync(String roleAssignmentId) { + final String tenantId = null; + return getByIdWithResponseAsync(roleAssignmentId, tenantId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a role assignment by ID. + * + * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource name, and + * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + * Example: + * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. + * @param tenantId Tenant ID for cross-tenant request. + * @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 a role assignment by ID along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByIdWithResponse( + String roleAssignmentId, String tenantId, Context context) { + return getByIdWithResponseAsync(roleAssignmentId, tenantId, context).block(); + } + + /** + * Get a role assignment by ID. + * + * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource name, and + * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + * Example: + * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 role assignment by ID. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoleAssignmentInner getById(String roleAssignmentId) { + final String tenantId = null; + return getByIdWithResponse(roleAssignmentId, tenantId, Context.NONE).getValue(); + } + + /** + * Create or update a role assignment by ID. + * + * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource name, and + * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + * Example: + * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. + * @param parameters Parameters for the role assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role Assignments along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createByIdWithResponseAsync( + String roleAssignmentId, RoleAssignmentCreateParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleAssignmentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2022-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createById( + this.client.getEndpoint(), roleAssignmentId, apiVersion, parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a role assignment by ID. + * + * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource name, and + * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + * Example: + * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. + * @param parameters Parameters for the role assignment. + * @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 role Assignments along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createByIdWithResponseAsync( + String roleAssignmentId, RoleAssignmentCreateParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleAssignmentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2022-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createById(this.client.getEndpoint(), roleAssignmentId, apiVersion, parameters, accept, context); + } + + /** + * Create or update a role assignment by ID. + * + * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource name, and + * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + * Example: + * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. + * @param parameters Parameters for the role assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role Assignments on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createByIdAsync( + String roleAssignmentId, RoleAssignmentCreateParameters parameters) { + return createByIdWithResponseAsync(roleAssignmentId, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create or update a role assignment by ID. + * + * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource name, and + * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + * Example: + * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. + * @param parameters Parameters for the role assignment. + * @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 role Assignments along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createByIdWithResponse( + String roleAssignmentId, RoleAssignmentCreateParameters parameters, Context context) { + return createByIdWithResponseAsync(roleAssignmentId, parameters, context).block(); + } + + /** + * Create or update a role assignment by ID. + * + * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource name, and + * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + * Example: + * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. + * @param parameters Parameters for the role assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role Assignments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoleAssignmentInner createById(String roleAssignmentId, RoleAssignmentCreateParameters parameters) { + return createByIdWithResponse(roleAssignmentId, parameters, Context.NONE).getValue(); + } + + /** + * Delete a role assignment by ID. + * + * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource name, and + * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + * Example: + * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. + * @param tenantId Tenant ID for cross-tenant request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role Assignments along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteByIdWithResponseAsync(String roleAssignmentId, String tenantId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleAssignmentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null.")); + } + final String apiVersion = "2022-04-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteById(this.client.getEndpoint(), roleAssignmentId, apiVersion, tenantId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a role assignment by ID. + * + * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource name, and + * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + * Example: + * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. + * @param tenantId Tenant ID for cross-tenant request. + * @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 role Assignments along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteByIdWithResponseAsync( + String roleAssignmentId, String tenantId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleAssignmentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null.")); + } + final String apiVersion = "2022-04-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.deleteById(this.client.getEndpoint(), roleAssignmentId, apiVersion, tenantId, accept, context); + } + + /** + * Delete a role assignment by ID. + * + * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource name, and + * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + * Example: + * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role Assignments on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteByIdAsync(String roleAssignmentId) { + final String tenantId = null; + return deleteByIdWithResponseAsync(roleAssignmentId, tenantId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Delete a role assignment by ID. + * + * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource name, and + * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + * Example: + * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. + * @param tenantId Tenant ID for cross-tenant request. + * @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 role Assignments along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteByIdWithResponse( + String roleAssignmentId, String tenantId, Context context) { + return deleteByIdWithResponseAsync(roleAssignmentId, tenantId, context).block(); + } + + /** + * Delete a role assignment by ID. + * + * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource name, and + * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + * Example: + * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role Assignments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoleAssignmentInner deleteById(String roleAssignmentId) { + final String tenantId = null; + return deleteByIdWithResponse(roleAssignmentId, tenantId, Context.NONE).getValue(); + } + + /** + * 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 role assignment list operation result along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForSubscriptionNextSinglePageAsync(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.listForSubscriptionNext(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 role assignment list operation result along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForSubscriptionNextSinglePageAsync( + 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 + .listForSubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 role assignment list operation result along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForResourceGroupNextSinglePageAsync(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.listForResourceGroupNext(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 role assignment list operation result along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForResourceGroupNextSinglePageAsync( + 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 + .listForResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 role assignment list operation result along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForResourceNextSinglePageAsync(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.listForResourceNext(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 role assignment list operation result along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForResourceNextSinglePageAsync( + 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 + .listForResourceNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 role assignment list operation result along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeNextSinglePageAsync(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.listForScopeNext(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 role assignment list operation result along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeNextSinglePageAsync(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 + .listForScopeNext(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/RoleAssignmentsImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleAssignmentsImpl.java new file mode 100644 index 000000000000..f2875d29bb48 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleAssignmentsImpl.java @@ -0,0 +1,226 @@ +// 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.RoleAssignmentsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleAssignmentInner; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignment; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignmentCreateParameters; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignments; + +public final class RoleAssignmentsImpl implements RoleAssignments { + private static final ClientLogger LOGGER = new ClientLogger(RoleAssignmentsImpl.class); + + private final RoleAssignmentsClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public RoleAssignmentsImpl( + RoleAssignmentsClient 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 RoleAssignmentImpl(inner1, this.manager())); + } + + public PagedIterable list(String filter, String tenantId, Context context) { + PagedIterable inner = this.serviceClient().list(filter, tenantId, context); + return Utils.mapPage(inner, inner1 -> new RoleAssignmentImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new RoleAssignmentImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup( + String resourceGroupName, String filter, String tenantId, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, filter, tenantId, context); + return Utils.mapPage(inner, inner1 -> new RoleAssignmentImpl(inner1, this.manager())); + } + + public PagedIterable listForResource( + String resourceGroupName, String resourceProviderNamespace, String resourceType, String resourceName) { + PagedIterable inner = + this + .serviceClient() + .listForResource(resourceGroupName, resourceProviderNamespace, resourceType, resourceName); + return Utils.mapPage(inner, inner1 -> new RoleAssignmentImpl(inner1, this.manager())); + } + + public PagedIterable listForResource( + String resourceGroupName, + String resourceProviderNamespace, + String resourceType, + String resourceName, + String filter, + String tenantId, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listForResource( + resourceGroupName, + resourceProviderNamespace, + resourceType, + resourceName, + filter, + tenantId, + context); + return Utils.mapPage(inner, inner1 -> new RoleAssignmentImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String scope, String roleAssignmentName, String tenantId, Context context) { + Response inner = + this.serviceClient().getWithResponse(scope, roleAssignmentName, tenantId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RoleAssignmentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RoleAssignment get(String scope, String roleAssignmentName) { + RoleAssignmentInner inner = this.serviceClient().get(scope, roleAssignmentName); + if (inner != null) { + return new RoleAssignmentImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse( + String scope, String roleAssignmentName, String tenantId, Context context) { + Response inner = + this.serviceClient().deleteWithResponse(scope, roleAssignmentName, tenantId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RoleAssignmentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RoleAssignment delete(String scope, String roleAssignmentName) { + RoleAssignmentInner inner = this.serviceClient().delete(scope, roleAssignmentName); + if (inner != null) { + return new RoleAssignmentImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listForScope(String scope) { + PagedIterable inner = this.serviceClient().listForScope(scope); + return Utils.mapPage(inner, inner1 -> new RoleAssignmentImpl(inner1, this.manager())); + } + + public PagedIterable listForScope( + String scope, String filter, String tenantId, String skipToken, Context context) { + PagedIterable inner = + this.serviceClient().listForScope(scope, filter, tenantId, skipToken, context); + return Utils.mapPage(inner, inner1 -> new RoleAssignmentImpl(inner1, this.manager())); + } + + public Response getByIdWithResponse(String roleAssignmentId, String tenantId, Context context) { + Response inner = + this.serviceClient().getByIdWithResponse(roleAssignmentId, tenantId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RoleAssignmentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RoleAssignment getById(String roleAssignmentId) { + RoleAssignmentInner inner = this.serviceClient().getById(roleAssignmentId); + if (inner != null) { + return new RoleAssignmentImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createByIdWithResponse( + String roleAssignmentId, RoleAssignmentCreateParameters parameters, Context context) { + Response inner = + this.serviceClient().createByIdWithResponse(roleAssignmentId, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RoleAssignmentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RoleAssignment createById(String roleAssignmentId, RoleAssignmentCreateParameters parameters) { + RoleAssignmentInner inner = this.serviceClient().createById(roleAssignmentId, parameters); + if (inner != null) { + return new RoleAssignmentImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteByIdWithResponse(String roleAssignmentId, String tenantId, Context context) { + Response inner = + this.serviceClient().deleteByIdWithResponse(roleAssignmentId, tenantId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RoleAssignmentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RoleAssignment deleteById(String roleAssignmentId) { + RoleAssignmentInner inner = this.serviceClient().deleteById(roleAssignmentId); + if (inner != null) { + return new RoleAssignmentImpl(inner, this.manager()); + } else { + return null; + } + } + + private RoleAssignmentsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } + + public RoleAssignmentImpl define(String name) { + return new RoleAssignmentImpl(name, this.manager()); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleDefinitionImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleDefinitionImpl.java new file mode 100644 index 000000000000..6cf5507a9a49 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleDefinitionImpl.java @@ -0,0 +1,216 @@ +// 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.PermissionInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleDefinitionInner; +import com.azure.resourcemanager.authorization.generated.models.Permission; +import com.azure.resourcemanager.authorization.generated.models.RoleDefinition; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class RoleDefinitionImpl implements RoleDefinition, RoleDefinition.Definition, RoleDefinition.Update { + private RoleDefinitionInner 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 roleName() { + return this.innerModel().roleName(); + } + + public String description() { + return this.innerModel().description(); + } + + public String roleType() { + return this.innerModel().roleType(); + } + + public List permissions() { + List inner = this.innerModel().permissions(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new PermissionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public List assignableScopes() { + List inner = this.innerModel().assignableScopes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public OffsetDateTime createdOn() { + return this.innerModel().createdOn(); + } + + public OffsetDateTime updatedOn() { + return this.innerModel().updatedOn(); + } + + public String createdBy() { + return this.innerModel().createdBy(); + } + + public String updatedBy() { + return this.innerModel().updatedBy(); + } + + public RoleDefinitionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } + + private String scope; + + private String roleDefinitionId; + + public RoleDefinitionImpl withExistingScope(String scope) { + this.scope = scope; + return this; + } + + public RoleDefinition create() { + this.innerObject = + serviceManager + .serviceClient() + .getRoleDefinitions() + .createOrUpdateWithResponse(scope, roleDefinitionId, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public RoleDefinition create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRoleDefinitions() + .createOrUpdateWithResponse(scope, roleDefinitionId, this.innerModel(), context) + .getValue(); + return this; + } + + RoleDefinitionImpl( + String name, com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerObject = new RoleDefinitionInner(); + this.serviceManager = serviceManager; + this.roleDefinitionId = name; + } + + public RoleDefinitionImpl update() { + return this; + } + + public RoleDefinition apply() { + this.innerObject = + serviceManager + .serviceClient() + .getRoleDefinitions() + .createOrUpdateWithResponse(scope, roleDefinitionId, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public RoleDefinition apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRoleDefinitions() + .createOrUpdateWithResponse(scope, roleDefinitionId, this.innerModel(), context) + .getValue(); + return this; + } + + RoleDefinitionImpl( + RoleDefinitionInner innerObject, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.scope = + Utils + .getValueFromIdByParameterName( + innerObject.id(), + "/{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}", + "scope"); + this.roleDefinitionId = + Utils + .getValueFromIdByParameterName( + innerObject.id(), + "/{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}", + "roleDefinitionId"); + } + + public RoleDefinition refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getRoleDefinitions() + .getWithResponse(scope, roleDefinitionId, Context.NONE) + .getValue(); + return this; + } + + public RoleDefinition refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRoleDefinitions() + .getWithResponse(scope, roleDefinitionId, context) + .getValue(); + return this; + } + + public RoleDefinitionImpl withRoleName(String roleName) { + this.innerModel().withRoleName(roleName); + return this; + } + + public RoleDefinitionImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public RoleDefinitionImpl withRoleType(String roleType) { + this.innerModel().withRoleType(roleType); + return this; + } + + public RoleDefinitionImpl withPermissions(List permissions) { + this.innerModel().withPermissions(permissions); + return this; + } + + public RoleDefinitionImpl withAssignableScopes(List assignableScopes) { + this.innerModel().withAssignableScopes(assignableScopes); + return this; + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleDefinitionsClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleDefinitionsClientImpl.java new file mode 100644 index 000000000000..cb306676a907 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleDefinitionsClientImpl.java @@ -0,0 +1,915 @@ +// 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.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.RoleDefinitionsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleDefinitionInner; +import com.azure.resourcemanager.authorization.generated.models.RoleDefinitionListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RoleDefinitionsClient. */ +public final class RoleDefinitionsClientImpl implements RoleDefinitionsClient { + /** The proxy service used to perform REST calls. */ + private final RoleDefinitionsService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of RoleDefinitionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RoleDefinitionsClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy.create(RoleDefinitionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AuthorizationManagementClientRoleDefinitions to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + public interface RoleDefinitionsService { + @Headers({"Content-Type: application/json"}) + @Delete("/{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam("roleDefinitionId") String roleDefinitionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam("roleDefinitionId") String roleDefinitionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put("/{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}") + @ExpectedResponses({201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam("roleDefinitionId") String roleDefinitionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RoleDefinitionInner roleDefinition, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/{scope}/providers/Microsoft.Authorization/roleDefinitions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @QueryParam("$filter") String filter, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/{roleId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getById( + @HostParam("$host") String endpoint, + @PathParam(value = "roleId", encoded = true) String roleId, + @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); + } + + /** + * Deletes a role definition. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleDefinitionId The ID of the role definition to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String scope, String roleDefinitionId) { + 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 (roleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null.")); + } + final String apiVersion = "2022-05-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service.delete(this.client.getEndpoint(), scope, roleDefinitionId, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a role definition. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleDefinitionId The ID of the role definition to delete. + * @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 role definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String scope, String roleDefinitionId, 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 (roleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null.")); + } + final String apiVersion = "2022-05-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), scope, roleDefinitionId, apiVersion, accept, context); + } + + /** + * Deletes a role definition. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleDefinitionId The ID of the role definition to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String scope, String roleDefinitionId) { + return deleteWithResponseAsync(scope, roleDefinitionId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Deletes a role definition. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleDefinitionId The ID of the role definition to delete. + * @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 role definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String scope, String roleDefinitionId, Context context) { + return deleteWithResponseAsync(scope, roleDefinitionId, context).block(); + } + + /** + * Deletes a role definition. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleDefinitionId The ID of the role definition to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoleDefinitionInner delete(String scope, String roleDefinitionId) { + return deleteWithResponse(scope, roleDefinitionId, Context.NONE).getValue(); + } + + /** + * Get role definition by ID (GUID). + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleDefinitionId The ID of the role 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 role definition by ID (GUID) along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String scope, String roleDefinitionId) { + 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 (roleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null.")); + } + final String apiVersion = "2022-05-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.get(this.client.getEndpoint(), scope, roleDefinitionId, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get role definition by ID (GUID). + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleDefinitionId The ID of the role 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 role definition by ID (GUID) along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String scope, String roleDefinitionId, 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 (roleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null.")); + } + final String apiVersion = "2022-05-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), scope, roleDefinitionId, apiVersion, accept, context); + } + + /** + * Get role definition by ID (GUID). + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleDefinitionId The ID of the role 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 role definition by ID (GUID) on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String scope, String roleDefinitionId) { + return getWithResponseAsync(scope, roleDefinitionId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get role definition by ID (GUID). + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleDefinitionId The ID of the role 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 role definition by ID (GUID) along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String scope, String roleDefinitionId, Context context) { + return getWithResponseAsync(scope, roleDefinitionId, context).block(); + } + + /** + * Get role definition by ID (GUID). + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleDefinitionId The ID of the role 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 role definition by ID (GUID). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoleDefinitionInner get(String scope, String roleDefinitionId) { + return getWithResponse(scope, roleDefinitionId, Context.NONE).getValue(); + } + + /** + * Creates or updates a role definition. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleDefinitionId The ID of the role definition. + * @param roleDefinition The values for the role 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 role definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String scope, String roleDefinitionId, RoleDefinitionInner roleDefinition) { + 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 (roleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null.")); + } + if (roleDefinition == null) { + return Mono.error(new IllegalArgumentException("Parameter roleDefinition is required and cannot be null.")); + } else { + roleDefinition.validate(); + } + final String apiVersion = "2022-05-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + scope, + roleDefinitionId, + apiVersion, + roleDefinition, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a role definition. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleDefinitionId The ID of the role definition. + * @param roleDefinition The values for the role 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 role definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String scope, String roleDefinitionId, RoleDefinitionInner roleDefinition, 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 (roleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null.")); + } + if (roleDefinition == null) { + return Mono.error(new IllegalArgumentException("Parameter roleDefinition is required and cannot be null.")); + } else { + roleDefinition.validate(); + } + final String apiVersion = "2022-05-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), scope, roleDefinitionId, apiVersion, roleDefinition, accept, context); + } + + /** + * Creates or updates a role definition. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleDefinitionId The ID of the role definition. + * @param roleDefinition The values for the role 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 role definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String scope, String roleDefinitionId, RoleDefinitionInner roleDefinition) { + return createOrUpdateWithResponseAsync(scope, roleDefinitionId, roleDefinition) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates a role definition. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleDefinitionId The ID of the role definition. + * @param roleDefinition The values for the role 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 role definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String scope, String roleDefinitionId, RoleDefinitionInner roleDefinition, Context context) { + return createOrUpdateWithResponseAsync(scope, roleDefinitionId, roleDefinition, context).block(); + } + + /** + * Creates or updates a role definition. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleDefinitionId The ID of the role definition. + * @param roleDefinition The values for the role 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 role definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoleDefinitionInner createOrUpdate( + String scope, String roleDefinitionId, RoleDefinitionInner roleDefinition) { + return createOrUpdateWithResponse(scope, roleDefinitionId, roleDefinition, Context.NONE).getValue(); + } + + /** + * Get all role definitions that are applicable at scope and above. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param filter The filter to apply on the operation. Use atScopeAndBelow filter to search below the given scope as + * well. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all role definitions that are applicable at scope and above 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 apiVersion = "2022-05-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), scope, filter, apiVersion, 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 all role definitions that are applicable at scope and above. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param filter The filter to apply on the operation. Use atScopeAndBelow filter to search below the given scope as + * well. + * @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 all role definitions that are applicable at scope and above 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 apiVersion = "2022-05-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), scope, filter, apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get all role definitions that are applicable at scope and above. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param filter The filter to apply on the operation. Use atScopeAndBelow filter to search below the given scope as + * well. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all role definitions that are applicable at scope and above 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 all role definitions that are applicable at scope and above. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all role definitions that are applicable at scope and above 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 all role definitions that are applicable at scope and above. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param filter The filter to apply on the operation. Use atScopeAndBelow filter to search below the given scope as + * well. + * @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 all role definitions that are applicable at scope and above 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 all role definitions that are applicable at scope and above. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all role definitions that are applicable at scope and above 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 all role definitions that are applicable at scope and above. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param filter The filter to apply on the operation. Use atScopeAndBelow filter to search below the given scope as + * well. + * @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 all role definitions that are applicable at scope and above 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)); + } + + /** + * Gets a role definition by ID. + * + * @param roleId The fully qualified role definition ID. Use the format, + * /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for subscription + * level role definitions, or /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for tenant + * level role definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 role definition by ID along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByIdWithResponseAsync(String roleId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleId == null) { + return Mono.error(new IllegalArgumentException("Parameter roleId is required and cannot be null.")); + } + final String apiVersion = "2022-05-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getById(this.client.getEndpoint(), roleId, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a role definition by ID. + * + * @param roleId The fully qualified role definition ID. Use the format, + * /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for subscription + * level role definitions, or /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for tenant + * level role definitions. + * @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 a role definition by ID along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByIdWithResponseAsync(String roleId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (roleId == null) { + return Mono.error(new IllegalArgumentException("Parameter roleId is required and cannot be null.")); + } + final String apiVersion = "2022-05-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getById(this.client.getEndpoint(), roleId, apiVersion, accept, context); + } + + /** + * Gets a role definition by ID. + * + * @param roleId The fully qualified role definition ID. Use the format, + * /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for subscription + * level role definitions, or /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for tenant + * level role definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 role definition by ID on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByIdAsync(String roleId) { + return getByIdWithResponseAsync(roleId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a role definition by ID. + * + * @param roleId The fully qualified role definition ID. Use the format, + * /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for subscription + * level role definitions, or /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for tenant + * level role definitions. + * @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 a role definition by ID along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByIdWithResponse(String roleId, Context context) { + return getByIdWithResponseAsync(roleId, context).block(); + } + + /** + * Gets a role definition by ID. + * + * @param roleId The fully qualified role definition ID. Use the format, + * /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for subscription + * level role definitions, or /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for tenant + * level role definitions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 role definition by ID. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoleDefinitionInner getById(String roleId) { + return getByIdWithResponse(roleId, Context.NONE).getValue(); + } + + /** + * 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 role definition list operation result 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 role definition list operation result 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/RoleDefinitionsImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleDefinitionsImpl.java new file mode 100644 index 000000000000..61c0b53b6cfd --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleDefinitionsImpl.java @@ -0,0 +1,173 @@ +// 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.RoleDefinitionsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleDefinitionInner; +import com.azure.resourcemanager.authorization.generated.models.RoleDefinition; +import com.azure.resourcemanager.authorization.generated.models.RoleDefinitions; + +public final class RoleDefinitionsImpl implements RoleDefinitions { + private static final ClientLogger LOGGER = new ClientLogger(RoleDefinitionsImpl.class); + + private final RoleDefinitionsClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public RoleDefinitionsImpl( + RoleDefinitionsClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response deleteByResourceGroupWithResponse( + String scope, String roleDefinitionId, Context context) { + Response inner = this.serviceClient().deleteWithResponse(scope, roleDefinitionId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RoleDefinitionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RoleDefinition deleteByResourceGroup(String scope, String roleDefinitionId) { + RoleDefinitionInner inner = this.serviceClient().delete(scope, roleDefinitionId); + if (inner != null) { + return new RoleDefinitionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String scope, String roleDefinitionId, Context context) { + Response inner = this.serviceClient().getWithResponse(scope, roleDefinitionId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RoleDefinitionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RoleDefinition get(String scope, String roleDefinitionId) { + RoleDefinitionInner inner = this.serviceClient().get(scope, roleDefinitionId); + if (inner != null) { + return new RoleDefinitionImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String scope) { + PagedIterable inner = this.serviceClient().list(scope); + return Utils.mapPage(inner, inner1 -> new RoleDefinitionImpl(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 RoleDefinitionImpl(inner1, this.manager())); + } + + public Response getByIdWithResponse(String roleId, Context context) { + Response inner = this.serviceClient().getByIdWithResponse(roleId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RoleDefinitionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RoleDefinition getById(String roleId) { + RoleDefinitionInner inner = this.serviceClient().getById(roleId); + if (inner != null) { + return new RoleDefinitionImpl(inner, this.manager()); + } else { + return null; + } + } + + public RoleDefinition deleteById(String id) { + String scope = + Utils + .getValueFromIdByParameterName( + id, "/{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}", "scope"); + if (scope == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); + } + String roleDefinitionId = + Utils + .getValueFromIdByParameterName( + id, + "/{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}", + "roleDefinitionId"); + if (roleDefinitionId == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'roleDefinitions'.", id))); + } + return this.deleteByResourceGroupWithResponse(scope, roleDefinitionId, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String scope = + Utils + .getValueFromIdByParameterName( + id, "/{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}", "scope"); + if (scope == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); + } + String roleDefinitionId = + Utils + .getValueFromIdByParameterName( + id, + "/{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}", + "roleDefinitionId"); + if (roleDefinitionId == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'roleDefinitions'.", id))); + } + return this.deleteByResourceGroupWithResponse(scope, roleDefinitionId, context); + } + + private RoleDefinitionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } + + public RoleDefinitionImpl define(String name) { + return new RoleDefinitionImpl(name, this.manager()); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleEligibilityScheduleImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleEligibilityScheduleImpl.java new file mode 100644 index 000000000000..0594bc7e80b2 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleEligibilityScheduleImpl.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.implementation; + +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleEligibilityScheduleInner; +import com.azure.resourcemanager.authorization.generated.models.ExpandedProperties; +import com.azure.resourcemanager.authorization.generated.models.MemberType; +import com.azure.resourcemanager.authorization.generated.models.PrincipalType; +import com.azure.resourcemanager.authorization.generated.models.RoleEligibilitySchedule; +import com.azure.resourcemanager.authorization.generated.models.Status; +import java.time.OffsetDateTime; + +public final class RoleEligibilityScheduleImpl implements RoleEligibilitySchedule { + private RoleEligibilityScheduleInner innerObject; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + RoleEligibilityScheduleImpl( + RoleEligibilityScheduleInner 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 scope() { + return this.innerModel().scope(); + } + + public String roleDefinitionId() { + return this.innerModel().roleDefinitionId(); + } + + public String principalId() { + return this.innerModel().principalId(); + } + + public PrincipalType principalType() { + return this.innerModel().principalType(); + } + + public String roleEligibilityScheduleRequestId() { + return this.innerModel().roleEligibilityScheduleRequestId(); + } + + public MemberType memberType() { + return this.innerModel().memberType(); + } + + public Status status() { + return this.innerModel().status(); + } + + public OffsetDateTime startDateTime() { + return this.innerModel().startDateTime(); + } + + public OffsetDateTime endDateTime() { + return this.innerModel().endDateTime(); + } + + public String condition() { + return this.innerModel().condition(); + } + + public String conditionVersion() { + return this.innerModel().conditionVersion(); + } + + public OffsetDateTime createdOn() { + return this.innerModel().createdOn(); + } + + public OffsetDateTime updatedOn() { + return this.innerModel().updatedOn(); + } + + public ExpandedProperties expandedProperties() { + return this.innerModel().expandedProperties(); + } + + public RoleEligibilityScheduleInner 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/RoleEligibilityScheduleInstanceImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleEligibilityScheduleInstanceImpl.java new file mode 100644 index 000000000000..f30e9ab8b243 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleEligibilityScheduleInstanceImpl.java @@ -0,0 +1,98 @@ +// 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.RoleEligibilityScheduleInstanceInner; +import com.azure.resourcemanager.authorization.generated.models.ExpandedProperties; +import com.azure.resourcemanager.authorization.generated.models.MemberType; +import com.azure.resourcemanager.authorization.generated.models.PrincipalType; +import com.azure.resourcemanager.authorization.generated.models.RoleEligibilityScheduleInstance; +import com.azure.resourcemanager.authorization.generated.models.Status; +import java.time.OffsetDateTime; + +public final class RoleEligibilityScheduleInstanceImpl implements RoleEligibilityScheduleInstance { + private RoleEligibilityScheduleInstanceInner innerObject; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + RoleEligibilityScheduleInstanceImpl( + RoleEligibilityScheduleInstanceInner 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 scope() { + return this.innerModel().scope(); + } + + public String roleDefinitionId() { + return this.innerModel().roleDefinitionId(); + } + + public String principalId() { + return this.innerModel().principalId(); + } + + public PrincipalType principalType() { + return this.innerModel().principalType(); + } + + public String roleEligibilityScheduleId() { + return this.innerModel().roleEligibilityScheduleId(); + } + + public Status status() { + return this.innerModel().status(); + } + + public OffsetDateTime startDateTime() { + return this.innerModel().startDateTime(); + } + + public OffsetDateTime endDateTime() { + return this.innerModel().endDateTime(); + } + + public MemberType memberType() { + return this.innerModel().memberType(); + } + + public String condition() { + return this.innerModel().condition(); + } + + public String conditionVersion() { + return this.innerModel().conditionVersion(); + } + + public OffsetDateTime createdOn() { + return this.innerModel().createdOn(); + } + + public ExpandedProperties expandedProperties() { + return this.innerModel().expandedProperties(); + } + + public RoleEligibilityScheduleInstanceInner 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/RoleEligibilityScheduleInstancesClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleEligibilityScheduleInstancesClientImpl.java new file mode 100644 index 000000000000..0f2732ca9f43 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleEligibilityScheduleInstancesClientImpl.java @@ -0,0 +1,500 @@ +// 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.RoleEligibilityScheduleInstancesClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleEligibilityScheduleInstanceInner; +import com.azure.resourcemanager.authorization.generated.models.RoleEligibilityScheduleInstanceListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in RoleEligibilityScheduleInstancesClient. + */ +public final class RoleEligibilityScheduleInstancesClientImpl implements RoleEligibilityScheduleInstancesClient { + /** The proxy service used to perform REST calls. */ + private final RoleEligibilityScheduleInstancesService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of RoleEligibilityScheduleInstancesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RoleEligibilityScheduleInstancesClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy + .create( + RoleEligibilityScheduleInstancesService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AuthorizationManagementClientRoleEligibilityScheduleInstances to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + public interface RoleEligibilityScheduleInstancesService { + @Headers({"Content-Type: application/json"}) + @Get("/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForScope( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @QueryParam("$filter") String filter, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances/{roleEligibilityScheduleInstanceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam("roleEligibilityScheduleInstanceName") String roleEligibilityScheduleInstanceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForScopeNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets role eligibility schedule instances of a role eligibility schedule. + * + * @param scope The scope of the role eligibility schedule. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + * at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or + * below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role + * eligibility schedules for the user. Use $filter=asTarget() to return all role eligibility schedules created + * for the current user. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role eligibility schedule instances of a role eligibility schedule along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeSinglePageAsync( + 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 apiVersion = "2020-10-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listForScope(this.client.getEndpoint(), scope, filter, apiVersion, 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())); + } + + /** + * Gets role eligibility schedule instances of a role eligibility schedule. + * + * @param scope The scope of the role eligibility schedule. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + * at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or + * below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role + * eligibility schedules for the user. Use $filter=asTarget() to return all role eligibility schedules created + * for the current user. + * @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 role eligibility schedule instances of a role eligibility schedule along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeSinglePageAsync( + 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 apiVersion = "2020-10-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listForScope(this.client.getEndpoint(), scope, filter, apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets role eligibility schedule instances of a role eligibility schedule. + * + * @param scope The scope of the role eligibility schedule. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + * at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or + * below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role + * eligibility schedules for the user. Use $filter=asTarget() to return all role eligibility schedules created + * for the current user. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role eligibility schedule instances of a role eligibility schedule as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForScopeAsync(String scope, String filter) { + return new PagedFlux<>( + () -> listForScopeSinglePageAsync(scope, filter), nextLink -> listForScopeNextSinglePageAsync(nextLink)); + } + + /** + * Gets role eligibility schedule instances of a role eligibility schedule. + * + * @param scope The scope of the role eligibility schedule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role eligibility schedule instances of a role eligibility schedule as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForScopeAsync(String scope) { + final String filter = null; + return new PagedFlux<>( + () -> listForScopeSinglePageAsync(scope, filter), nextLink -> listForScopeNextSinglePageAsync(nextLink)); + } + + /** + * Gets role eligibility schedule instances of a role eligibility schedule. + * + * @param scope The scope of the role eligibility schedule. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + * at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or + * below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role + * eligibility schedules for the user. Use $filter=asTarget() to return all role eligibility schedules created + * for the current user. + * @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 role eligibility schedule instances of a role eligibility schedule as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForScopeAsync( + String scope, String filter, Context context) { + return new PagedFlux<>( + () -> listForScopeSinglePageAsync(scope, filter, context), + nextLink -> listForScopeNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets role eligibility schedule instances of a role eligibility schedule. + * + * @param scope The scope of the role eligibility schedule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role eligibility schedule instances of a role eligibility schedule as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForScope(String scope) { + final String filter = null; + return new PagedIterable<>(listForScopeAsync(scope, filter)); + } + + /** + * Gets role eligibility schedule instances of a role eligibility schedule. + * + * @param scope The scope of the role eligibility schedule. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + * at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or + * below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role + * eligibility schedules for the user. Use $filter=asTarget() to return all role eligibility schedules created + * for the current user. + * @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 role eligibility schedule instances of a role eligibility schedule as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForScope( + String scope, String filter, Context context) { + return new PagedIterable<>(listForScopeAsync(scope, filter, context)); + } + + /** + * Gets the specified role eligibility schedule instance. + * + * @param scope The scope of the role eligibility schedules. + * @param roleEligibilityScheduleInstanceName The name (hash of schedule name + time) of the role eligibility + * schedule to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified role eligibility schedule instance along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String scope, String roleEligibilityScheduleInstanceName) { + 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 (roleEligibilityScheduleInstanceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter roleEligibilityScheduleInstanceName is required and cannot be null.")); + } + final String apiVersion = "2020-10-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + scope, + roleEligibilityScheduleInstanceName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified role eligibility schedule instance. + * + * @param scope The scope of the role eligibility schedules. + * @param roleEligibilityScheduleInstanceName The name (hash of schedule name + time) of the role eligibility + * schedule to get. + * @param 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 specified role eligibility schedule instance along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String scope, String roleEligibilityScheduleInstanceName, 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 (roleEligibilityScheduleInstanceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter roleEligibilityScheduleInstanceName is required and cannot be null.")); + } + final String apiVersion = "2020-10-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get(this.client.getEndpoint(), scope, roleEligibilityScheduleInstanceName, apiVersion, accept, context); + } + + /** + * Gets the specified role eligibility schedule instance. + * + * @param scope The scope of the role eligibility schedules. + * @param roleEligibilityScheduleInstanceName The name (hash of schedule name + time) of the role eligibility + * schedule to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified role eligibility schedule instance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String scope, String roleEligibilityScheduleInstanceName) { + return getWithResponseAsync(scope, roleEligibilityScheduleInstanceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the specified role eligibility schedule instance. + * + * @param scope The scope of the role eligibility schedules. + * @param roleEligibilityScheduleInstanceName The name (hash of schedule name + time) of the role eligibility + * schedule to get. + * @param 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 specified role eligibility schedule instance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String scope, String roleEligibilityScheduleInstanceName, Context context) { + return getWithResponseAsync(scope, roleEligibilityScheduleInstanceName, context).block(); + } + + /** + * Gets the specified role eligibility schedule instance. + * + * @param scope The scope of the role eligibility schedules. + * @param roleEligibilityScheduleInstanceName The name (hash of schedule name + time) of the role eligibility + * schedule to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified role eligibility schedule instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoleEligibilityScheduleInstanceInner get(String scope, String roleEligibilityScheduleInstanceName) { + return getWithResponse(scope, roleEligibilityScheduleInstanceName, Context.NONE).getValue(); + } + + /** + * 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 role eligibility schedule instance list operation result along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeNextSinglePageAsync(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.listForScopeNext(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 role eligibility schedule instance list operation result along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeNextSinglePageAsync( + 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 + .listForScopeNext(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/RoleEligibilityScheduleInstancesImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleEligibilityScheduleInstancesImpl.java new file mode 100644 index 000000000000..5b44bd0aa91c --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleEligibilityScheduleInstancesImpl.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.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.RoleEligibilityScheduleInstancesClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleEligibilityScheduleInstanceInner; +import com.azure.resourcemanager.authorization.generated.models.RoleEligibilityScheduleInstance; +import com.azure.resourcemanager.authorization.generated.models.RoleEligibilityScheduleInstances; + +public final class RoleEligibilityScheduleInstancesImpl implements RoleEligibilityScheduleInstances { + private static final ClientLogger LOGGER = new ClientLogger(RoleEligibilityScheduleInstancesImpl.class); + + private final RoleEligibilityScheduleInstancesClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public RoleEligibilityScheduleInstancesImpl( + RoleEligibilityScheduleInstancesClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listForScope(String scope) { + PagedIterable inner = this.serviceClient().listForScope(scope); + return Utils.mapPage(inner, inner1 -> new RoleEligibilityScheduleInstanceImpl(inner1, this.manager())); + } + + public PagedIterable listForScope(String scope, String filter, Context context) { + PagedIterable inner = + this.serviceClient().listForScope(scope, filter, context); + return Utils.mapPage(inner, inner1 -> new RoleEligibilityScheduleInstanceImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String scope, String roleEligibilityScheduleInstanceName, Context context) { + Response inner = + this.serviceClient().getWithResponse(scope, roleEligibilityScheduleInstanceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RoleEligibilityScheduleInstanceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RoleEligibilityScheduleInstance get(String scope, String roleEligibilityScheduleInstanceName) { + RoleEligibilityScheduleInstanceInner inner = + this.serviceClient().get(scope, roleEligibilityScheduleInstanceName); + if (inner != null) { + return new RoleEligibilityScheduleInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + private RoleEligibilityScheduleInstancesClient 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/RoleEligibilityScheduleRequestImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleEligibilityScheduleRequestImpl.java new file mode 100644 index 000000000000..3d7036e702a8 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleEligibilityScheduleRequestImpl.java @@ -0,0 +1,252 @@ +// 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.RoleEligibilityScheduleRequestInner; +import com.azure.resourcemanager.authorization.generated.models.ExpandedProperties; +import com.azure.resourcemanager.authorization.generated.models.PrincipalType; +import com.azure.resourcemanager.authorization.generated.models.RequestType; +import com.azure.resourcemanager.authorization.generated.models.RoleEligibilityScheduleRequest; +import com.azure.resourcemanager.authorization.generated.models.RoleEligibilityScheduleRequestPropertiesScheduleInfo; +import com.azure.resourcemanager.authorization.generated.models.RoleEligibilityScheduleRequestPropertiesTicketInfo; +import com.azure.resourcemanager.authorization.generated.models.Status; +import java.time.OffsetDateTime; + +public final class RoleEligibilityScheduleRequestImpl + implements RoleEligibilityScheduleRequest, RoleEligibilityScheduleRequest.Definition { + private RoleEligibilityScheduleRequestInner innerObject; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + RoleEligibilityScheduleRequestImpl( + RoleEligibilityScheduleRequestInner 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 scope() { + return this.innerModel().scope(); + } + + public String roleDefinitionId() { + return this.innerModel().roleDefinitionId(); + } + + public String principalId() { + return this.innerModel().principalId(); + } + + public PrincipalType principalType() { + return this.innerModel().principalType(); + } + + public RequestType requestType() { + return this.innerModel().requestType(); + } + + public Status status() { + return this.innerModel().status(); + } + + public String approvalId() { + return this.innerModel().approvalId(); + } + + public RoleEligibilityScheduleRequestPropertiesScheduleInfo scheduleInfo() { + return this.innerModel().scheduleInfo(); + } + + public String targetRoleEligibilityScheduleId() { + return this.innerModel().targetRoleEligibilityScheduleId(); + } + + public String targetRoleEligibilityScheduleInstanceId() { + return this.innerModel().targetRoleEligibilityScheduleInstanceId(); + } + + public String justification() { + return this.innerModel().justification(); + } + + public RoleEligibilityScheduleRequestPropertiesTicketInfo ticketInfo() { + return this.innerModel().ticketInfo(); + } + + public String condition() { + return this.innerModel().condition(); + } + + public String conditionVersion() { + return this.innerModel().conditionVersion(); + } + + public OffsetDateTime createdOn() { + return this.innerModel().createdOn(); + } + + public String requestorId() { + return this.innerModel().requestorId(); + } + + public ExpandedProperties expandedProperties() { + return this.innerModel().expandedProperties(); + } + + public RoleEligibilityScheduleRequestInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } + + private String scope; + + private String roleEligibilityScheduleRequestName; + + public RoleEligibilityScheduleRequestImpl withExistingScope(String scope) { + this.scope = scope; + return this; + } + + public RoleEligibilityScheduleRequest create() { + this.innerObject = + serviceManager + .serviceClient() + .getRoleEligibilityScheduleRequests() + .createWithResponse(scope, roleEligibilityScheduleRequestName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public RoleEligibilityScheduleRequest create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRoleEligibilityScheduleRequests() + .createWithResponse(scope, roleEligibilityScheduleRequestName, this.innerModel(), context) + .getValue(); + return this; + } + + RoleEligibilityScheduleRequestImpl( + String name, com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerObject = new RoleEligibilityScheduleRequestInner(); + this.serviceManager = serviceManager; + this.roleEligibilityScheduleRequestName = name; + } + + public RoleEligibilityScheduleRequest refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getRoleEligibilityScheduleRequests() + .getWithResponse(scope, roleEligibilityScheduleRequestName, Context.NONE) + .getValue(); + return this; + } + + public RoleEligibilityScheduleRequest refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRoleEligibilityScheduleRequests() + .getWithResponse(scope, roleEligibilityScheduleRequestName, context) + .getValue(); + return this; + } + + public Response cancelWithResponse(Context context) { + return serviceManager + .roleEligibilityScheduleRequests() + .cancelWithResponse(scope, roleEligibilityScheduleRequestName, context); + } + + public void cancel() { + serviceManager.roleEligibilityScheduleRequests().cancel(scope, roleEligibilityScheduleRequestName); + } + + public Response validateWithResponse( + RoleEligibilityScheduleRequestInner parameters, Context context) { + return serviceManager + .roleEligibilityScheduleRequests() + .validateWithResponse(scope, roleEligibilityScheduleRequestName, parameters, context); + } + + public RoleEligibilityScheduleRequest validate(RoleEligibilityScheduleRequestInner parameters) { + return serviceManager + .roleEligibilityScheduleRequests() + .validate(scope, roleEligibilityScheduleRequestName, parameters); + } + + public RoleEligibilityScheduleRequestImpl withRoleDefinitionId(String roleDefinitionId) { + this.innerModel().withRoleDefinitionId(roleDefinitionId); + return this; + } + + public RoleEligibilityScheduleRequestImpl withPrincipalId(String principalId) { + this.innerModel().withPrincipalId(principalId); + return this; + } + + public RoleEligibilityScheduleRequestImpl withRequestType(RequestType requestType) { + this.innerModel().withRequestType(requestType); + return this; + } + + public RoleEligibilityScheduleRequestImpl withScheduleInfo( + RoleEligibilityScheduleRequestPropertiesScheduleInfo scheduleInfo) { + this.innerModel().withScheduleInfo(scheduleInfo); + return this; + } + + public RoleEligibilityScheduleRequestImpl withTargetRoleEligibilityScheduleId( + String targetRoleEligibilityScheduleId) { + this.innerModel().withTargetRoleEligibilityScheduleId(targetRoleEligibilityScheduleId); + return this; + } + + public RoleEligibilityScheduleRequestImpl withTargetRoleEligibilityScheduleInstanceId( + String targetRoleEligibilityScheduleInstanceId) { + this.innerModel().withTargetRoleEligibilityScheduleInstanceId(targetRoleEligibilityScheduleInstanceId); + return this; + } + + public RoleEligibilityScheduleRequestImpl withJustification(String justification) { + this.innerModel().withJustification(justification); + return this; + } + + public RoleEligibilityScheduleRequestImpl withTicketInfo( + RoleEligibilityScheduleRequestPropertiesTicketInfo ticketInfo) { + this.innerModel().withTicketInfo(ticketInfo); + return this; + } + + public RoleEligibilityScheduleRequestImpl withCondition(String condition) { + this.innerModel().withCondition(condition); + return this; + } + + public RoleEligibilityScheduleRequestImpl withConditionVersion(String conditionVersion) { + this.innerModel().withConditionVersion(conditionVersion); + return this; + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleEligibilityScheduleRequestsClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleEligibilityScheduleRequestsClientImpl.java new file mode 100644 index 000000000000..2b050c4aa153 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleEligibilityScheduleRequestsClientImpl.java @@ -0,0 +1,1009 @@ +// 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.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.RoleEligibilityScheduleRequestsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleEligibilityScheduleRequestInner; +import com.azure.resourcemanager.authorization.generated.models.RoleEligibilityScheduleRequestListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RoleEligibilityScheduleRequestsClient. */ +public final class RoleEligibilityScheduleRequestsClientImpl implements RoleEligibilityScheduleRequestsClient { + /** The proxy service used to perform REST calls. */ + private final RoleEligibilityScheduleRequestsService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of RoleEligibilityScheduleRequestsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RoleEligibilityScheduleRequestsClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy + .create( + RoleEligibilityScheduleRequestsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AuthorizationManagementClientRoleEligibilityScheduleRequests to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + public interface RoleEligibilityScheduleRequestsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}") + @ExpectedResponses({201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam("roleEligibilityScheduleRequestName") String roleEligibilityScheduleRequestName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RoleEligibilityScheduleRequestInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam("roleEligibilityScheduleRequestName") String roleEligibilityScheduleRequestName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForScope( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @QueryParam("$filter") String filter, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}/cancel") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> cancel( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam("roleEligibilityScheduleRequestName") String roleEligibilityScheduleRequestName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}/validate") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> validate( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam("roleEligibilityScheduleRequestName") String roleEligibilityScheduleRequestName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RoleEligibilityScheduleRequestInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForScopeNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates a role eligibility schedule request. + * + * @param scope The scope of the role eligibility schedule request to create. The scope can be any REST resource + * instance. For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a + * subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param roleEligibilityScheduleRequestName The name of the role eligibility to create. It can be any valid GUID. + * @param parameters Parameters for the role eligibility schedule request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role Eligibility schedule request along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String scope, String roleEligibilityScheduleRequestName, RoleEligibilityScheduleRequestInner parameters) { + 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 (roleEligibilityScheduleRequestName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter roleEligibilityScheduleRequestName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2022-04-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + scope, + roleEligibilityScheduleRequestName, + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a role eligibility schedule request. + * + * @param scope The scope of the role eligibility schedule request to create. The scope can be any REST resource + * instance. For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a + * subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param roleEligibilityScheduleRequestName The name of the role eligibility to create. It can be any valid GUID. + * @param parameters Parameters for the role eligibility schedule request. + * @param 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 role Eligibility schedule request along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String scope, + String roleEligibilityScheduleRequestName, + RoleEligibilityScheduleRequestInner parameters, + 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 (roleEligibilityScheduleRequestName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter roleEligibilityScheduleRequestName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2022-04-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + scope, + roleEligibilityScheduleRequestName, + apiVersion, + parameters, + accept, + context); + } + + /** + * Creates a role eligibility schedule request. + * + * @param scope The scope of the role eligibility schedule request to create. The scope can be any REST resource + * instance. For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a + * subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param roleEligibilityScheduleRequestName The name of the role eligibility to create. It can be any valid GUID. + * @param parameters Parameters for the role eligibility schedule request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role Eligibility schedule request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String scope, String roleEligibilityScheduleRequestName, RoleEligibilityScheduleRequestInner parameters) { + return createWithResponseAsync(scope, roleEligibilityScheduleRequestName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates a role eligibility schedule request. + * + * @param scope The scope of the role eligibility schedule request to create. The scope can be any REST resource + * instance. For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a + * subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param roleEligibilityScheduleRequestName The name of the role eligibility to create. It can be any valid GUID. + * @param parameters Parameters for the role eligibility schedule request. + * @param 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 role Eligibility schedule request along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String scope, + String roleEligibilityScheduleRequestName, + RoleEligibilityScheduleRequestInner parameters, + Context context) { + return createWithResponseAsync(scope, roleEligibilityScheduleRequestName, parameters, context).block(); + } + + /** + * Creates a role eligibility schedule request. + * + * @param scope The scope of the role eligibility schedule request to create. The scope can be any REST resource + * instance. For example, use '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a + * subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param roleEligibilityScheduleRequestName The name of the role eligibility to create. It can be any valid GUID. + * @param parameters Parameters for the role eligibility schedule request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role Eligibility schedule request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoleEligibilityScheduleRequestInner create( + String scope, String roleEligibilityScheduleRequestName, RoleEligibilityScheduleRequestInner parameters) { + return createWithResponse(scope, roleEligibilityScheduleRequestName, parameters, Context.NONE).getValue(); + } + + /** + * Get the specified role eligibility schedule request. + * + * @param scope The scope of the role eligibility schedule request. + * @param roleEligibilityScheduleRequestName The name (guid) of the role eligibility schedule request to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified role eligibility schedule request along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String scope, String roleEligibilityScheduleRequestName) { + 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 (roleEligibilityScheduleRequestName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter roleEligibilityScheduleRequestName is required and cannot be null.")); + } + final String apiVersion = "2022-04-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + scope, + roleEligibilityScheduleRequestName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the specified role eligibility schedule request. + * + * @param scope The scope of the role eligibility schedule request. + * @param roleEligibilityScheduleRequestName The name (guid) of the role eligibility schedule request to get. + * @param 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 specified role eligibility schedule request along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String scope, String roleEligibilityScheduleRequestName, 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 (roleEligibilityScheduleRequestName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter roleEligibilityScheduleRequestName is required and cannot be null.")); + } + final String apiVersion = "2022-04-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get(this.client.getEndpoint(), scope, roleEligibilityScheduleRequestName, apiVersion, accept, context); + } + + /** + * Get the specified role eligibility schedule request. + * + * @param scope The scope of the role eligibility schedule request. + * @param roleEligibilityScheduleRequestName The name (guid) of the role eligibility schedule request to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified role eligibility schedule request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String scope, String roleEligibilityScheduleRequestName) { + return getWithResponseAsync(scope, roleEligibilityScheduleRequestName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the specified role eligibility schedule request. + * + * @param scope The scope of the role eligibility schedule request. + * @param roleEligibilityScheduleRequestName The name (guid) of the role eligibility schedule request to get. + * @param 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 specified role eligibility schedule request along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String scope, String roleEligibilityScheduleRequestName, Context context) { + return getWithResponseAsync(scope, roleEligibilityScheduleRequestName, context).block(); + } + + /** + * Get the specified role eligibility schedule request. + * + * @param scope The scope of the role eligibility schedule request. + * @param roleEligibilityScheduleRequestName The name (guid) of the role eligibility schedule request to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified role eligibility schedule request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoleEligibilityScheduleRequestInner get(String scope, String roleEligibilityScheduleRequestName) { + return getWithResponse(scope, roleEligibilityScheduleRequestName, Context.NONE).getValue(); + } + + /** + * Gets role eligibility schedule requests for a scope. + * + * @param scope The scope of the role eligibility schedule requests. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedule + * requests at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedule + * requests at, above or below the scope for the specified principal. Use $filter=asRequestor() to return all + * role eligibility schedule requests requested by the current user. Use $filter=asTarget() to return all role + * eligibility schedule requests created for the current user. Use $filter=asApprover() to return all role + * eligibility schedule requests where the current user is an approver. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role eligibility schedule requests for a scope along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeSinglePageAsync( + 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 apiVersion = "2022-04-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listForScope(this.client.getEndpoint(), scope, filter, apiVersion, 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())); + } + + /** + * Gets role eligibility schedule requests for a scope. + * + * @param scope The scope of the role eligibility schedule requests. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedule + * requests at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedule + * requests at, above or below the scope for the specified principal. Use $filter=asRequestor() to return all + * role eligibility schedule requests requested by the current user. Use $filter=asTarget() to return all role + * eligibility schedule requests created for the current user. Use $filter=asApprover() to return all role + * eligibility schedule requests where the current user is an approver. + * @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 role eligibility schedule requests for a scope along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeSinglePageAsync( + 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 apiVersion = "2022-04-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listForScope(this.client.getEndpoint(), scope, filter, apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets role eligibility schedule requests for a scope. + * + * @param scope The scope of the role eligibility schedule requests. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedule + * requests at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedule + * requests at, above or below the scope for the specified principal. Use $filter=asRequestor() to return all + * role eligibility schedule requests requested by the current user. Use $filter=asTarget() to return all role + * eligibility schedule requests created for the current user. Use $filter=asApprover() to return all role + * eligibility schedule requests where the current user is an approver. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role eligibility schedule requests for a scope as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForScopeAsync(String scope, String filter) { + return new PagedFlux<>( + () -> listForScopeSinglePageAsync(scope, filter), nextLink -> listForScopeNextSinglePageAsync(nextLink)); + } + + /** + * Gets role eligibility schedule requests for a scope. + * + * @param scope The scope of the role eligibility schedule requests. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role eligibility schedule requests for a scope as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForScopeAsync(String scope) { + final String filter = null; + return new PagedFlux<>( + () -> listForScopeSinglePageAsync(scope, filter), nextLink -> listForScopeNextSinglePageAsync(nextLink)); + } + + /** + * Gets role eligibility schedule requests for a scope. + * + * @param scope The scope of the role eligibility schedule requests. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedule + * requests at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedule + * requests at, above or below the scope for the specified principal. Use $filter=asRequestor() to return all + * role eligibility schedule requests requested by the current user. Use $filter=asTarget() to return all role + * eligibility schedule requests created for the current user. Use $filter=asApprover() to return all role + * eligibility schedule requests where the current user is an approver. + * @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 role eligibility schedule requests for a scope as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForScopeAsync( + String scope, String filter, Context context) { + return new PagedFlux<>( + () -> listForScopeSinglePageAsync(scope, filter, context), + nextLink -> listForScopeNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets role eligibility schedule requests for a scope. + * + * @param scope The scope of the role eligibility schedule requests. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role eligibility schedule requests for a scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForScope(String scope) { + final String filter = null; + return new PagedIterable<>(listForScopeAsync(scope, filter)); + } + + /** + * Gets role eligibility schedule requests for a scope. + * + * @param scope The scope of the role eligibility schedule requests. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedule + * requests at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedule + * requests at, above or below the scope for the specified principal. Use $filter=asRequestor() to return all + * role eligibility schedule requests requested by the current user. Use $filter=asTarget() to return all role + * eligibility schedule requests created for the current user. Use $filter=asApprover() to return all role + * eligibility schedule requests where the current user is an approver. + * @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 role eligibility schedule requests for a scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForScope( + String scope, String filter, Context context) { + return new PagedIterable<>(listForScopeAsync(scope, filter, context)); + } + + /** + * Cancels a pending role eligibility schedule request. + * + * @param scope The scope of the role eligibility request to cancel. + * @param roleEligibilityScheduleRequestName The name of the role eligibility request to cancel. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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> cancelWithResponseAsync(String scope, String roleEligibilityScheduleRequestName) { + 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 (roleEligibilityScheduleRequestName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter roleEligibilityScheduleRequestName is required and cannot be null.")); + } + final String apiVersion = "2022-04-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .cancel( + this.client.getEndpoint(), + scope, + roleEligibilityScheduleRequestName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Cancels a pending role eligibility schedule request. + * + * @param scope The scope of the role eligibility request to cancel. + * @param roleEligibilityScheduleRequestName The name of the role eligibility request to cancel. + * @param 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> cancelWithResponseAsync( + String scope, String roleEligibilityScheduleRequestName, 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 (roleEligibilityScheduleRequestName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter roleEligibilityScheduleRequestName is required and cannot be null.")); + } + final String apiVersion = "2022-04-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .cancel(this.client.getEndpoint(), scope, roleEligibilityScheduleRequestName, apiVersion, accept, context); + } + + /** + * Cancels a pending role eligibility schedule request. + * + * @param scope The scope of the role eligibility request to cancel. + * @param roleEligibilityScheduleRequestName The name of the role eligibility request to cancel. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cancelAsync(String scope, String roleEligibilityScheduleRequestName) { + return cancelWithResponseAsync(scope, roleEligibilityScheduleRequestName).flatMap(ignored -> Mono.empty()); + } + + /** + * Cancels a pending role eligibility schedule request. + * + * @param scope The scope of the role eligibility request to cancel. + * @param roleEligibilityScheduleRequestName The name of the role eligibility request to cancel. + * @param 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 cancelWithResponse(String scope, String roleEligibilityScheduleRequestName, Context context) { + return cancelWithResponseAsync(scope, roleEligibilityScheduleRequestName, context).block(); + } + + /** + * Cancels a pending role eligibility schedule request. + * + * @param scope The scope of the role eligibility request to cancel. + * @param roleEligibilityScheduleRequestName The name of the role eligibility request to cancel. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 cancel(String scope, String roleEligibilityScheduleRequestName) { + cancelWithResponse(scope, roleEligibilityScheduleRequestName, Context.NONE); + } + + /** + * Validates a new role eligibility schedule request. + * + * @param scope The scope of the role eligibility request to validate. + * @param roleEligibilityScheduleRequestName The name of the role eligibility request to validate. + * @param parameters Parameters for the role eligibility schedule request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role Eligibility schedule request along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateWithResponseAsync( + String scope, String roleEligibilityScheduleRequestName, RoleEligibilityScheduleRequestInner parameters) { + 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 (roleEligibilityScheduleRequestName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter roleEligibilityScheduleRequestName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2022-04-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .validate( + this.client.getEndpoint(), + scope, + roleEligibilityScheduleRequestName, + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Validates a new role eligibility schedule request. + * + * @param scope The scope of the role eligibility request to validate. + * @param roleEligibilityScheduleRequestName The name of the role eligibility request to validate. + * @param parameters Parameters for the role eligibility schedule request. + * @param 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 role Eligibility schedule request along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateWithResponseAsync( + String scope, + String roleEligibilityScheduleRequestName, + RoleEligibilityScheduleRequestInner parameters, + 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 (roleEligibilityScheduleRequestName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter roleEligibilityScheduleRequestName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2022-04-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .validate( + this.client.getEndpoint(), + scope, + roleEligibilityScheduleRequestName, + apiVersion, + parameters, + accept, + context); + } + + /** + * Validates a new role eligibility schedule request. + * + * @param scope The scope of the role eligibility request to validate. + * @param roleEligibilityScheduleRequestName The name of the role eligibility request to validate. + * @param parameters Parameters for the role eligibility schedule request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role Eligibility schedule request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateAsync( + String scope, String roleEligibilityScheduleRequestName, RoleEligibilityScheduleRequestInner parameters) { + return validateWithResponseAsync(scope, roleEligibilityScheduleRequestName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Validates a new role eligibility schedule request. + * + * @param scope The scope of the role eligibility request to validate. + * @param roleEligibilityScheduleRequestName The name of the role eligibility request to validate. + * @param parameters Parameters for the role eligibility schedule request. + * @param 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 role Eligibility schedule request along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response validateWithResponse( + String scope, + String roleEligibilityScheduleRequestName, + RoleEligibilityScheduleRequestInner parameters, + Context context) { + return validateWithResponseAsync(scope, roleEligibilityScheduleRequestName, parameters, context).block(); + } + + /** + * Validates a new role eligibility schedule request. + * + * @param scope The scope of the role eligibility request to validate. + * @param roleEligibilityScheduleRequestName The name of the role eligibility request to validate. + * @param parameters Parameters for the role eligibility schedule request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role Eligibility schedule request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoleEligibilityScheduleRequestInner validate( + String scope, String roleEligibilityScheduleRequestName, RoleEligibilityScheduleRequestInner parameters) { + return validateWithResponse(scope, roleEligibilityScheduleRequestName, parameters, Context.NONE).getValue(); + } + + /** + * 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 role eligibility schedule request list operation result along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeNextSinglePageAsync(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.listForScopeNext(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 role eligibility schedule request list operation result along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeNextSinglePageAsync( + 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 + .listForScopeNext(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/RoleEligibilityScheduleRequestsImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleEligibilityScheduleRequestsImpl.java new file mode 100644 index 000000000000..f39677f0467c --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleEligibilityScheduleRequestsImpl.java @@ -0,0 +1,178 @@ +// 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.RoleEligibilityScheduleRequestsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleEligibilityScheduleRequestInner; +import com.azure.resourcemanager.authorization.generated.models.RoleEligibilityScheduleRequest; +import com.azure.resourcemanager.authorization.generated.models.RoleEligibilityScheduleRequests; + +public final class RoleEligibilityScheduleRequestsImpl implements RoleEligibilityScheduleRequests { + private static final ClientLogger LOGGER = new ClientLogger(RoleEligibilityScheduleRequestsImpl.class); + + private final RoleEligibilityScheduleRequestsClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public RoleEligibilityScheduleRequestsImpl( + RoleEligibilityScheduleRequestsClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String scope, String roleEligibilityScheduleRequestName, Context context) { + Response inner = + this.serviceClient().getWithResponse(scope, roleEligibilityScheduleRequestName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RoleEligibilityScheduleRequestImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RoleEligibilityScheduleRequest get(String scope, String roleEligibilityScheduleRequestName) { + RoleEligibilityScheduleRequestInner inner = this.serviceClient().get(scope, roleEligibilityScheduleRequestName); + if (inner != null) { + return new RoleEligibilityScheduleRequestImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listForScope(String scope) { + PagedIterable inner = this.serviceClient().listForScope(scope); + return Utils.mapPage(inner, inner1 -> new RoleEligibilityScheduleRequestImpl(inner1, this.manager())); + } + + public PagedIterable listForScope(String scope, String filter, Context context) { + PagedIterable inner = + this.serviceClient().listForScope(scope, filter, context); + return Utils.mapPage(inner, inner1 -> new RoleEligibilityScheduleRequestImpl(inner1, this.manager())); + } + + public Response cancelWithResponse(String scope, String roleEligibilityScheduleRequestName, Context context) { + return this.serviceClient().cancelWithResponse(scope, roleEligibilityScheduleRequestName, context); + } + + public void cancel(String scope, String roleEligibilityScheduleRequestName) { + this.serviceClient().cancel(scope, roleEligibilityScheduleRequestName); + } + + public Response validateWithResponse( + String scope, + String roleEligibilityScheduleRequestName, + RoleEligibilityScheduleRequestInner parameters, + Context context) { + Response inner = + this.serviceClient().validateWithResponse(scope, roleEligibilityScheduleRequestName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RoleEligibilityScheduleRequestImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RoleEligibilityScheduleRequest validate( + String scope, String roleEligibilityScheduleRequestName, RoleEligibilityScheduleRequestInner parameters) { + RoleEligibilityScheduleRequestInner inner = + this.serviceClient().validate(scope, roleEligibilityScheduleRequestName, parameters); + if (inner != null) { + return new RoleEligibilityScheduleRequestImpl(inner, this.manager()); + } else { + return null; + } + } + + public RoleEligibilityScheduleRequest getById(String id) { + String scope = + Utils + .getValueFromIdByParameterName( + id, + "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}", + "scope"); + if (scope == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); + } + String roleEligibilityScheduleRequestName = + Utils + .getValueFromIdByParameterName( + id, + "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}", + "roleEligibilityScheduleRequestName"); + if (roleEligibilityScheduleRequestName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'roleEligibilityScheduleRequests'.", + id))); + } + return this.getWithResponse(scope, roleEligibilityScheduleRequestName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String scope = + Utils + .getValueFromIdByParameterName( + id, + "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}", + "scope"); + if (scope == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); + } + String roleEligibilityScheduleRequestName = + Utils + .getValueFromIdByParameterName( + id, + "/{scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{roleEligibilityScheduleRequestName}", + "roleEligibilityScheduleRequestName"); + if (roleEligibilityScheduleRequestName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'roleEligibilityScheduleRequests'.", + id))); + } + return this.getWithResponse(scope, roleEligibilityScheduleRequestName, context); + } + + private RoleEligibilityScheduleRequestsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } + + public RoleEligibilityScheduleRequestImpl define(String name) { + return new RoleEligibilityScheduleRequestImpl(name, this.manager()); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleEligibilitySchedulesClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleEligibilitySchedulesClientImpl.java new file mode 100644 index 000000000000..c7f78c0b0363 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleEligibilitySchedulesClientImpl.java @@ -0,0 +1,474 @@ +// 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.RoleEligibilitySchedulesClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleEligibilityScheduleInner; +import com.azure.resourcemanager.authorization.generated.models.RoleEligibilityScheduleListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RoleEligibilitySchedulesClient. */ +public final class RoleEligibilitySchedulesClientImpl implements RoleEligibilitySchedulesClient { + /** The proxy service used to perform REST calls. */ + private final RoleEligibilitySchedulesService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of RoleEligibilitySchedulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RoleEligibilitySchedulesClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy + .create(RoleEligibilitySchedulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AuthorizationManagementClientRoleEligibilitySchedules to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + public interface RoleEligibilitySchedulesService { + @Headers({"Content-Type: application/json"}) + @Get("/{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules/{roleEligibilityScheduleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam("roleEligibilityScheduleName") String roleEligibilityScheduleName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/{scope}/providers/Microsoft.Authorization/roleEligibilitySchedules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForScope( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @QueryParam("$filter") String filter, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForScopeNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the specified role eligibility schedule for a resource scope. + * + * @param scope The scope of the role eligibility schedule. + * @param roleEligibilityScheduleName The name (guid) of the role eligibility schedule to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified role eligibility schedule for a resource scope along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String scope, String roleEligibilityScheduleName) { + 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 (roleEligibilityScheduleName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter roleEligibilityScheduleName is required and cannot be null.")); + } + final String apiVersion = "2020-10-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), scope, roleEligibilityScheduleName, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the specified role eligibility schedule for a resource scope. + * + * @param scope The scope of the role eligibility schedule. + * @param roleEligibilityScheduleName The name (guid) of the role eligibility schedule to get. + * @param 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 specified role eligibility schedule for a resource scope along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String scope, String roleEligibilityScheduleName, 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 (roleEligibilityScheduleName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter roleEligibilityScheduleName is required and cannot be null.")); + } + final String apiVersion = "2020-10-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), scope, roleEligibilityScheduleName, apiVersion, accept, context); + } + + /** + * Get the specified role eligibility schedule for a resource scope. + * + * @param scope The scope of the role eligibility schedule. + * @param roleEligibilityScheduleName The name (guid) of the role eligibility schedule to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified role eligibility schedule for a resource scope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String scope, String roleEligibilityScheduleName) { + return getWithResponseAsync(scope, roleEligibilityScheduleName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the specified role eligibility schedule for a resource scope. + * + * @param scope The scope of the role eligibility schedule. + * @param roleEligibilityScheduleName The name (guid) of the role eligibility schedule to get. + * @param 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 specified role eligibility schedule for a resource scope along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String scope, String roleEligibilityScheduleName, Context context) { + return getWithResponseAsync(scope, roleEligibilityScheduleName, context).block(); + } + + /** + * Get the specified role eligibility schedule for a resource scope. + * + * @param scope The scope of the role eligibility schedule. + * @param roleEligibilityScheduleName The name (guid) of the role eligibility schedule to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified role eligibility schedule for a resource scope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoleEligibilityScheduleInner get(String scope, String roleEligibilityScheduleName) { + return getWithResponse(scope, roleEligibilityScheduleName, Context.NONE).getValue(); + } + + /** + * Gets role eligibility schedules for a resource scope. + * + * @param scope The scope of the role eligibility schedules. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role eligibility + * schedules at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedules at, + * above or below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role + * eligibility schedules for the user. Use $filter=asTarget() to return all role eligibility schedules created + * for the current user. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role eligibility schedules for a resource scope along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeSinglePageAsync(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 apiVersion = "2020-10-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listForScope(this.client.getEndpoint(), scope, filter, apiVersion, 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())); + } + + /** + * Gets role eligibility schedules for a resource scope. + * + * @param scope The scope of the role eligibility schedules. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role eligibility + * schedules at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedules at, + * above or below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role + * eligibility schedules for the user. Use $filter=asTarget() to return all role eligibility schedules created + * for the current user. + * @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 role eligibility schedules for a resource scope along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeSinglePageAsync( + 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 apiVersion = "2020-10-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listForScope(this.client.getEndpoint(), scope, filter, apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets role eligibility schedules for a resource scope. + * + * @param scope The scope of the role eligibility schedules. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role eligibility + * schedules at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedules at, + * above or below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role + * eligibility schedules for the user. Use $filter=asTarget() to return all role eligibility schedules created + * for the current user. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role eligibility schedules for a resource scope as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForScopeAsync(String scope, String filter) { + return new PagedFlux<>( + () -> listForScopeSinglePageAsync(scope, filter), nextLink -> listForScopeNextSinglePageAsync(nextLink)); + } + + /** + * Gets role eligibility schedules for a resource scope. + * + * @param scope The scope of the role eligibility schedules. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role eligibility schedules for a resource scope as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForScopeAsync(String scope) { + final String filter = null; + return new PagedFlux<>( + () -> listForScopeSinglePageAsync(scope, filter), nextLink -> listForScopeNextSinglePageAsync(nextLink)); + } + + /** + * Gets role eligibility schedules for a resource scope. + * + * @param scope The scope of the role eligibility schedules. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role eligibility + * schedules at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedules at, + * above or below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role + * eligibility schedules for the user. Use $filter=asTarget() to return all role eligibility schedules created + * for the current user. + * @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 role eligibility schedules for a resource scope as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForScopeAsync(String scope, String filter, Context context) { + return new PagedFlux<>( + () -> listForScopeSinglePageAsync(scope, filter, context), + nextLink -> listForScopeNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets role eligibility schedules for a resource scope. + * + * @param scope The scope of the role eligibility schedules. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role eligibility schedules for a resource scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForScope(String scope) { + final String filter = null; + return new PagedIterable<>(listForScopeAsync(scope, filter)); + } + + /** + * Gets role eligibility schedules for a resource scope. + * + * @param scope The scope of the role eligibility schedules. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role eligibility + * schedules at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedules at, + * above or below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role + * eligibility schedules for the user. Use $filter=asTarget() to return all role eligibility schedules created + * for the current user. + * @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 role eligibility schedules for a resource scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForScope(String scope, String filter, Context context) { + return new PagedIterable<>(listForScopeAsync(scope, 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 role eligibility schedule list operation result along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeNextSinglePageAsync(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.listForScopeNext(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 role eligibility schedule list operation result along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeNextSinglePageAsync( + 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 + .listForScopeNext(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/RoleEligibilitySchedulesImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleEligibilitySchedulesImpl.java new file mode 100644 index 000000000000..9d095d1dfe27 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleEligibilitySchedulesImpl.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.RoleEligibilitySchedulesClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleEligibilityScheduleInner; +import com.azure.resourcemanager.authorization.generated.models.RoleEligibilitySchedule; +import com.azure.resourcemanager.authorization.generated.models.RoleEligibilitySchedules; + +public final class RoleEligibilitySchedulesImpl implements RoleEligibilitySchedules { + private static final ClientLogger LOGGER = new ClientLogger(RoleEligibilitySchedulesImpl.class); + + private final RoleEligibilitySchedulesClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public RoleEligibilitySchedulesImpl( + RoleEligibilitySchedulesClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String scope, String roleEligibilityScheduleName, Context context) { + Response inner = + this.serviceClient().getWithResponse(scope, roleEligibilityScheduleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RoleEligibilityScheduleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RoleEligibilitySchedule get(String scope, String roleEligibilityScheduleName) { + RoleEligibilityScheduleInner inner = this.serviceClient().get(scope, roleEligibilityScheduleName); + if (inner != null) { + return new RoleEligibilityScheduleImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listForScope(String scope) { + PagedIterable inner = this.serviceClient().listForScope(scope); + return Utils.mapPage(inner, inner1 -> new RoleEligibilityScheduleImpl(inner1, this.manager())); + } + + public PagedIterable listForScope(String scope, String filter, Context context) { + PagedIterable inner = this.serviceClient().listForScope(scope, filter, context); + return Utils.mapPage(inner, inner1 -> new RoleEligibilityScheduleImpl(inner1, this.manager())); + } + + private RoleEligibilitySchedulesClient 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/RoleManagementPoliciesClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleManagementPoliciesClientImpl.java new file mode 100644 index 000000000000..3604563e64c5 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleManagementPoliciesClientImpl.java @@ -0,0 +1,714 @@ +// 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.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.RoleManagementPoliciesClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleManagementPolicyInner; +import com.azure.resourcemanager.authorization.generated.models.RoleManagementPolicyListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RoleManagementPoliciesClient. */ +public final class RoleManagementPoliciesClientImpl implements RoleManagementPoliciesClient { + /** The proxy service used to perform REST calls. */ + private final RoleManagementPoliciesService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of RoleManagementPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RoleManagementPoliciesClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy + .create(RoleManagementPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AuthorizationManagementClientRoleManagementPolicies to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + public interface RoleManagementPoliciesService { + @Headers({"Content-Type: application/json"}) + @Get("/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam("roleManagementPolicyName") String roleManagementPolicyName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch("/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam("roleManagementPolicyName") String roleManagementPolicyName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RoleManagementPolicyInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete("/{scope}/providers/Microsoft.Authorization/roleManagementPolicies/{roleManagementPolicyName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam("roleManagementPolicyName") String roleManagementPolicyName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/{scope}/providers/Microsoft.Authorization/roleManagementPolicies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForScope( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForScopeNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the specified role management policy for a resource scope. + * + * @param scope The scope of the role management policy. + * @param roleManagementPolicyName The name (guid) of the role management policy to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified role management policy for a resource scope along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String scope, String roleManagementPolicyName) { + 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 (roleManagementPolicyName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter roleManagementPolicyName is required and cannot be null.")); + } + final String apiVersion = "2020-10-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get(this.client.getEndpoint(), scope, roleManagementPolicyName, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the specified role management policy for a resource scope. + * + * @param scope The scope of the role management policy. + * @param roleManagementPolicyName The name (guid) of the role management policy to get. + * @param 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 specified role management policy for a resource scope along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String scope, String roleManagementPolicyName, 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 (roleManagementPolicyName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter roleManagementPolicyName is required and cannot be null.")); + } + final String apiVersion = "2020-10-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), scope, roleManagementPolicyName, apiVersion, accept, context); + } + + /** + * Get the specified role management policy for a resource scope. + * + * @param scope The scope of the role management policy. + * @param roleManagementPolicyName The name (guid) of the role management policy to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified role management policy for a resource scope on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String scope, String roleManagementPolicyName) { + return getWithResponseAsync(scope, roleManagementPolicyName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the specified role management policy for a resource scope. + * + * @param scope The scope of the role management policy. + * @param roleManagementPolicyName The name (guid) of the role management policy to get. + * @param 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 specified role management policy for a resource scope along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String scope, String roleManagementPolicyName, Context context) { + return getWithResponseAsync(scope, roleManagementPolicyName, context).block(); + } + + /** + * Get the specified role management policy for a resource scope. + * + * @param scope The scope of the role management policy. + * @param roleManagementPolicyName The name (guid) of the role management policy to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified role management policy for a resource scope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoleManagementPolicyInner get(String scope, String roleManagementPolicyName) { + return getWithResponse(scope, roleManagementPolicyName, Context.NONE).getValue(); + } + + /** + * Update a role management policy. + * + * @param scope The scope of the role management policy to upsert. + * @param roleManagementPolicyName The name (guid) of the role management policy to upsert. + * @param parameters Parameters for the role management policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role management policy along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String scope, String roleManagementPolicyName, RoleManagementPolicyInner parameters) { + 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 (roleManagementPolicyName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter roleManagementPolicyName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2020-10-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + scope, + roleManagementPolicyName, + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a role management policy. + * + * @param scope The scope of the role management policy to upsert. + * @param roleManagementPolicyName The name (guid) of the role management policy to upsert. + * @param parameters Parameters for the role management policy. + * @param 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 role management policy along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String scope, String roleManagementPolicyName, RoleManagementPolicyInner parameters, 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 (roleManagementPolicyName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter roleManagementPolicyName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2020-10-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), scope, roleManagementPolicyName, apiVersion, parameters, accept, context); + } + + /** + * Update a role management policy. + * + * @param scope The scope of the role management policy to upsert. + * @param roleManagementPolicyName The name (guid) of the role management policy to upsert. + * @param parameters Parameters for the role management policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role management policy on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String scope, String roleManagementPolicyName, RoleManagementPolicyInner parameters) { + return updateWithResponseAsync(scope, roleManagementPolicyName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Update a role management policy. + * + * @param scope The scope of the role management policy to upsert. + * @param roleManagementPolicyName The name (guid) of the role management policy to upsert. + * @param parameters Parameters for the role management policy. + * @param 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 role management policy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String scope, String roleManagementPolicyName, RoleManagementPolicyInner parameters, Context context) { + return updateWithResponseAsync(scope, roleManagementPolicyName, parameters, context).block(); + } + + /** + * Update a role management policy. + * + * @param scope The scope of the role management policy to upsert. + * @param roleManagementPolicyName The name (guid) of the role management policy to upsert. + * @param parameters Parameters for the role management policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role management policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoleManagementPolicyInner update( + String scope, String roleManagementPolicyName, RoleManagementPolicyInner parameters) { + return updateWithResponse(scope, roleManagementPolicyName, parameters, Context.NONE).getValue(); + } + + /** + * Delete a role management policy. + * + * @param scope The scope of the role management policy to upsert. + * @param roleManagementPolicyName The name (guid) of the role management policy to upsert. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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> deleteWithResponseAsync(String scope, String roleManagementPolicyName) { + 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 (roleManagementPolicyName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter roleManagementPolicyName is required and cannot be null.")); + } + final String apiVersion = "2020-10-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), scope, roleManagementPolicyName, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a role management policy. + * + * @param scope The scope of the role management policy to upsert. + * @param roleManagementPolicyName The name (guid) of the role management policy to upsert. + * @param 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> deleteWithResponseAsync( + String scope, String roleManagementPolicyName, 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 (roleManagementPolicyName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter roleManagementPolicyName is required and cannot be null.")); + } + final String apiVersion = "2020-10-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), scope, roleManagementPolicyName, apiVersion, accept, context); + } + + /** + * Delete a role management policy. + * + * @param scope The scope of the role management policy to upsert. + * @param roleManagementPolicyName The name (guid) of the role management policy to upsert. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deleteAsync(String scope, String roleManagementPolicyName) { + return deleteWithResponseAsync(scope, roleManagementPolicyName).flatMap(ignored -> Mono.empty()); + } + + /** + * Delete a role management policy. + * + * @param scope The scope of the role management policy to upsert. + * @param roleManagementPolicyName The name (guid) of the role management policy to upsert. + * @param 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 deleteWithResponse(String scope, String roleManagementPolicyName, Context context) { + return deleteWithResponseAsync(scope, roleManagementPolicyName, context).block(); + } + + /** + * Delete a role management policy. + * + * @param scope The scope of the role management policy to upsert. + * @param roleManagementPolicyName The name (guid) of the role management policy to upsert. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 delete(String scope, String roleManagementPolicyName) { + deleteWithResponse(scope, roleManagementPolicyName, Context.NONE); + } + + /** + * Gets role management policies for a resource scope. + * + * @param scope The scope of the role management policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role management policies for a resource scope along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeSinglePageAsync(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 apiVersion = "2020-10-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listForScope(this.client.getEndpoint(), scope, apiVersion, 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())); + } + + /** + * Gets role management policies for a resource scope. + * + * @param scope The scope of the role management policy. + * @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 role management policies for a resource scope along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeSinglePageAsync(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 apiVersion = "2020-10-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listForScope(this.client.getEndpoint(), scope, apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets role management policies for a resource scope. + * + * @param scope The scope of the role management policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role management policies for a resource scope as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForScopeAsync(String scope) { + return new PagedFlux<>( + () -> listForScopeSinglePageAsync(scope), nextLink -> listForScopeNextSinglePageAsync(nextLink)); + } + + /** + * Gets role management policies for a resource scope. + * + * @param scope The scope of the role management policy. + * @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 role management policies for a resource scope as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForScopeAsync(String scope, Context context) { + return new PagedFlux<>( + () -> listForScopeSinglePageAsync(scope, context), + nextLink -> listForScopeNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets role management policies for a resource scope. + * + * @param scope The scope of the role management policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role management policies for a resource scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForScope(String scope) { + return new PagedIterable<>(listForScopeAsync(scope)); + } + + /** + * Gets role management policies for a resource scope. + * + * @param scope The scope of the role management policy. + * @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 role management policies for a resource scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForScope(String scope, Context context) { + return new PagedIterable<>(listForScopeAsync(scope, 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 role management policy list operation result along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeNextSinglePageAsync(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.listForScopeNext(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 role management policy list operation result along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeNextSinglePageAsync( + 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 + .listForScopeNext(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/RoleManagementPoliciesImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleManagementPoliciesImpl.java new file mode 100644 index 000000000000..0715b47ab524 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleManagementPoliciesImpl.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.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.RoleManagementPoliciesClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleManagementPolicyInner; +import com.azure.resourcemanager.authorization.generated.models.RoleManagementPolicies; +import com.azure.resourcemanager.authorization.generated.models.RoleManagementPolicy; + +public final class RoleManagementPoliciesImpl implements RoleManagementPolicies { + private static final ClientLogger LOGGER = new ClientLogger(RoleManagementPoliciesImpl.class); + + private final RoleManagementPoliciesClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public RoleManagementPoliciesImpl( + RoleManagementPoliciesClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String scope, String roleManagementPolicyName, Context context) { + Response inner = + this.serviceClient().getWithResponse(scope, roleManagementPolicyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RoleManagementPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RoleManagementPolicy get(String scope, String roleManagementPolicyName) { + RoleManagementPolicyInner inner = this.serviceClient().get(scope, roleManagementPolicyName); + if (inner != null) { + return new RoleManagementPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response updateWithResponse( + String scope, String roleManagementPolicyName, RoleManagementPolicyInner parameters, Context context) { + Response inner = + this.serviceClient().updateWithResponse(scope, roleManagementPolicyName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RoleManagementPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RoleManagementPolicy update( + String scope, String roleManagementPolicyName, RoleManagementPolicyInner parameters) { + RoleManagementPolicyInner inner = this.serviceClient().update(scope, roleManagementPolicyName, parameters); + if (inner != null) { + return new RoleManagementPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteByResourceGroupWithResponse( + String scope, String roleManagementPolicyName, Context context) { + return this.serviceClient().deleteWithResponse(scope, roleManagementPolicyName, context); + } + + public void deleteByResourceGroup(String scope, String roleManagementPolicyName) { + this.serviceClient().delete(scope, roleManagementPolicyName); + } + + public PagedIterable listForScope(String scope) { + PagedIterable inner = this.serviceClient().listForScope(scope); + return Utils.mapPage(inner, inner1 -> new RoleManagementPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listForScope(String scope, Context context) { + PagedIterable inner = this.serviceClient().listForScope(scope, context); + return Utils.mapPage(inner, inner1 -> new RoleManagementPolicyImpl(inner1, this.manager())); + } + + private RoleManagementPoliciesClient 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/RoleManagementPolicyAssignmentImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleManagementPolicyAssignmentImpl.java new file mode 100644 index 000000000000..5f6fbfddce2d --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleManagementPolicyAssignmentImpl.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.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleManagementPolicyAssignmentInner; +import com.azure.resourcemanager.authorization.generated.models.PolicyAssignmentProperties; +import com.azure.resourcemanager.authorization.generated.models.RoleManagementPolicyAssignment; + +public final class RoleManagementPolicyAssignmentImpl + implements RoleManagementPolicyAssignment, RoleManagementPolicyAssignment.Definition { + private RoleManagementPolicyAssignmentInner innerObject; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + RoleManagementPolicyAssignmentImpl( + RoleManagementPolicyAssignmentInner 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 scope() { + return this.innerModel().scope(); + } + + public String roleDefinitionId() { + return this.innerModel().roleDefinitionId(); + } + + public String policyId() { + return this.innerModel().policyId(); + } + + public PolicyAssignmentProperties policyAssignmentProperties() { + return this.innerModel().policyAssignmentProperties(); + } + + public RoleManagementPolicyAssignmentInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } + + private String scope; + + private String roleManagementPolicyAssignmentName; + + public RoleManagementPolicyAssignmentImpl withExistingScope(String scope) { + this.scope = scope; + return this; + } + + public RoleManagementPolicyAssignment create() { + this.innerObject = + serviceManager + .serviceClient() + .getRoleManagementPolicyAssignments() + .createWithResponse(scope, roleManagementPolicyAssignmentName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public RoleManagementPolicyAssignment create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRoleManagementPolicyAssignments() + .createWithResponse(scope, roleManagementPolicyAssignmentName, this.innerModel(), context) + .getValue(); + return this; + } + + RoleManagementPolicyAssignmentImpl( + String name, com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerObject = new RoleManagementPolicyAssignmentInner(); + this.serviceManager = serviceManager; + this.roleManagementPolicyAssignmentName = name; + } + + public RoleManagementPolicyAssignment refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getRoleManagementPolicyAssignments() + .getWithResponse(scope, roleManagementPolicyAssignmentName, Context.NONE) + .getValue(); + return this; + } + + public RoleManagementPolicyAssignment refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRoleManagementPolicyAssignments() + .getWithResponse(scope, roleManagementPolicyAssignmentName, context) + .getValue(); + return this; + } + + public RoleManagementPolicyAssignmentImpl withScope(String scope) { + this.innerModel().withScope(scope); + return this; + } + + public RoleManagementPolicyAssignmentImpl withRoleDefinitionId(String roleDefinitionId) { + this.innerModel().withRoleDefinitionId(roleDefinitionId); + return this; + } + + public RoleManagementPolicyAssignmentImpl withPolicyId(String policyId) { + this.innerModel().withPolicyId(policyId); + return this; + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleManagementPolicyAssignmentsClientImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleManagementPolicyAssignmentsClientImpl.java new file mode 100644 index 000000000000..0fe77062671d --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleManagementPolicyAssignmentsClientImpl.java @@ -0,0 +1,772 @@ +// 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.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.RoleManagementPolicyAssignmentsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleManagementPolicyAssignmentInner; +import com.azure.resourcemanager.authorization.generated.models.RoleManagementPolicyAssignmentListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RoleManagementPolicyAssignmentsClient. */ +public final class RoleManagementPolicyAssignmentsClientImpl implements RoleManagementPolicyAssignmentsClient { + /** The proxy service used to perform REST calls. */ + private final RoleManagementPolicyAssignmentsService service; + + /** The service client containing this operation class. */ + private final AuthorizationManagementClientImpl client; + + /** + * Initializes an instance of RoleManagementPolicyAssignmentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RoleManagementPolicyAssignmentsClientImpl(AuthorizationManagementClientImpl client) { + this.service = + RestProxy + .create( + RoleManagementPolicyAssignmentsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AuthorizationManagementClientRoleManagementPolicyAssignments to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AuthorizationManagem") + public interface RoleManagementPolicyAssignmentsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam("roleManagementPolicyAssignmentName") String roleManagementPolicyAssignmentName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}") + @ExpectedResponses({201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam("roleManagementPolicyAssignmentName") String roleManagementPolicyAssignmentName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RoleManagementPolicyAssignmentInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam("roleManagementPolicyAssignmentName") String roleManagementPolicyAssignmentName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForScope( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForScopeNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the specified role management policy assignment for a resource scope. + * + * @param scope The scope of the role management policy. + * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy assignment to + * get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified role management policy assignment for a resource scope along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String scope, String roleManagementPolicyAssignmentName) { + 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 (roleManagementPolicyAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter roleManagementPolicyAssignmentName is required and cannot be null.")); + } + final String apiVersion = "2020-10-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + scope, + roleManagementPolicyAssignmentName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the specified role management policy assignment for a resource scope. + * + * @param scope The scope of the role management policy. + * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy assignment to + * get. + * @param 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 specified role management policy assignment for a resource scope along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String scope, String roleManagementPolicyAssignmentName, 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 (roleManagementPolicyAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter roleManagementPolicyAssignmentName is required and cannot be null.")); + } + final String apiVersion = "2020-10-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get(this.client.getEndpoint(), scope, roleManagementPolicyAssignmentName, apiVersion, accept, context); + } + + /** + * Get the specified role management policy assignment for a resource scope. + * + * @param scope The scope of the role management policy. + * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy assignment to + * get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified role management policy assignment for a resource scope on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String scope, String roleManagementPolicyAssignmentName) { + return getWithResponseAsync(scope, roleManagementPolicyAssignmentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the specified role management policy assignment for a resource scope. + * + * @param scope The scope of the role management policy. + * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy assignment to + * get. + * @param 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 specified role management policy assignment for a resource scope along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String scope, String roleManagementPolicyAssignmentName, Context context) { + return getWithResponseAsync(scope, roleManagementPolicyAssignmentName, context).block(); + } + + /** + * Get the specified role management policy assignment for a resource scope. + * + * @param scope The scope of the role management policy. + * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy assignment to + * get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specified role management policy assignment for a resource scope. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoleManagementPolicyAssignmentInner get(String scope, String roleManagementPolicyAssignmentName) { + return getWithResponse(scope, roleManagementPolicyAssignmentName, Context.NONE).getValue(); + } + + /** + * Create a role management policy assignment. + * + * @param scope The scope of the role management policy assignment to upsert. + * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy assignment to + * upsert. + * @param parameters Parameters for the role management policy assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role management policy along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String scope, String roleManagementPolicyAssignmentName, RoleManagementPolicyAssignmentInner parameters) { + 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 (roleManagementPolicyAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter roleManagementPolicyAssignmentName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2020-10-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + scope, + roleManagementPolicyAssignmentName, + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a role management policy assignment. + * + * @param scope The scope of the role management policy assignment to upsert. + * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy assignment to + * upsert. + * @param parameters Parameters for the role management policy assignment. + * @param 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 role management policy along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String scope, + String roleManagementPolicyAssignmentName, + RoleManagementPolicyAssignmentInner parameters, + 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 (roleManagementPolicyAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter roleManagementPolicyAssignmentName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2020-10-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + scope, + roleManagementPolicyAssignmentName, + apiVersion, + parameters, + accept, + context); + } + + /** + * Create a role management policy assignment. + * + * @param scope The scope of the role management policy assignment to upsert. + * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy assignment to + * upsert. + * @param parameters Parameters for the role management policy assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role management policy on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String scope, String roleManagementPolicyAssignmentName, RoleManagementPolicyAssignmentInner parameters) { + return createWithResponseAsync(scope, roleManagementPolicyAssignmentName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create a role management policy assignment. + * + * @param scope The scope of the role management policy assignment to upsert. + * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy assignment to + * upsert. + * @param parameters Parameters for the role management policy assignment. + * @param 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 role management policy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String scope, + String roleManagementPolicyAssignmentName, + RoleManagementPolicyAssignmentInner parameters, + Context context) { + return createWithResponseAsync(scope, roleManagementPolicyAssignmentName, parameters, context).block(); + } + + /** + * Create a role management policy assignment. + * + * @param scope The scope of the role management policy assignment to upsert. + * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy assignment to + * upsert. + * @param parameters Parameters for the role management policy assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role management policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoleManagementPolicyAssignmentInner create( + String scope, String roleManagementPolicyAssignmentName, RoleManagementPolicyAssignmentInner parameters) { + return createWithResponse(scope, roleManagementPolicyAssignmentName, parameters, Context.NONE).getValue(); + } + + /** + * Delete a role management policy assignment. + * + * @param scope The scope of the role management policy assignment to delete. + * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy assignment to + * delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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> deleteWithResponseAsync(String scope, String roleManagementPolicyAssignmentName) { + 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 (roleManagementPolicyAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter roleManagementPolicyAssignmentName is required and cannot be null.")); + } + final String apiVersion = "2020-10-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + scope, + roleManagementPolicyAssignmentName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a role management policy assignment. + * + * @param scope The scope of the role management policy assignment to delete. + * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy assignment to + * delete. + * @param 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> deleteWithResponseAsync( + String scope, String roleManagementPolicyAssignmentName, 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 (roleManagementPolicyAssignmentName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter roleManagementPolicyAssignmentName is required and cannot be null.")); + } + final String apiVersion = "2020-10-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete(this.client.getEndpoint(), scope, roleManagementPolicyAssignmentName, apiVersion, accept, context); + } + + /** + * Delete a role management policy assignment. + * + * @param scope The scope of the role management policy assignment to delete. + * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy assignment to + * delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deleteAsync(String scope, String roleManagementPolicyAssignmentName) { + return deleteWithResponseAsync(scope, roleManagementPolicyAssignmentName).flatMap(ignored -> Mono.empty()); + } + + /** + * Delete a role management policy assignment. + * + * @param scope The scope of the role management policy assignment to delete. + * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy assignment to + * delete. + * @param 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 deleteWithResponse(String scope, String roleManagementPolicyAssignmentName, Context context) { + return deleteWithResponseAsync(scope, roleManagementPolicyAssignmentName, context).block(); + } + + /** + * Delete a role management policy assignment. + * + * @param scope The scope of the role management policy assignment to delete. + * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy assignment to + * delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 delete(String scope, String roleManagementPolicyAssignmentName) { + deleteWithResponse(scope, roleManagementPolicyAssignmentName, Context.NONE); + } + + /** + * Gets role management assignment policies for a resource scope. + * + * @param scope The scope of the role management policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role management assignment policies for a resource scope along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeSinglePageAsync(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 apiVersion = "2020-10-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listForScope(this.client.getEndpoint(), scope, apiVersion, 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())); + } + + /** + * Gets role management assignment policies for a resource scope. + * + * @param scope The scope of the role management policy. + * @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 role management assignment policies for a resource scope along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeSinglePageAsync( + 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 apiVersion = "2020-10-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listForScope(this.client.getEndpoint(), scope, apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets role management assignment policies for a resource scope. + * + * @param scope The scope of the role management policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role management assignment policies for a resource scope as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForScopeAsync(String scope) { + return new PagedFlux<>( + () -> listForScopeSinglePageAsync(scope), nextLink -> listForScopeNextSinglePageAsync(nextLink)); + } + + /** + * Gets role management assignment policies for a resource scope. + * + * @param scope The scope of the role management policy. + * @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 role management assignment policies for a resource scope as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForScopeAsync(String scope, Context context) { + return new PagedFlux<>( + () -> listForScopeSinglePageAsync(scope, context), + nextLink -> listForScopeNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets role management assignment policies for a resource scope. + * + * @param scope The scope of the role management policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return role management assignment policies for a resource scope as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForScope(String scope) { + return new PagedIterable<>(listForScopeAsync(scope)); + } + + /** + * Gets role management assignment policies for a resource scope. + * + * @param scope The scope of the role management policy. + * @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 role management assignment policies for a resource scope as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForScope(String scope, Context context) { + return new PagedIterable<>(listForScopeAsync(scope, 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 role management policy assignment list operation result along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeNextSinglePageAsync(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.listForScopeNext(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 role management policy assignment list operation result along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForScopeNextSinglePageAsync( + 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 + .listForScopeNext(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/RoleManagementPolicyAssignmentsImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleManagementPolicyAssignmentsImpl.java new file mode 100644 index 000000000000..af9b4d339ff4 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleManagementPolicyAssignmentsImpl.java @@ -0,0 +1,213 @@ +// 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.RoleManagementPolicyAssignmentsClient; +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleManagementPolicyAssignmentInner; +import com.azure.resourcemanager.authorization.generated.models.RoleManagementPolicyAssignment; +import com.azure.resourcemanager.authorization.generated.models.RoleManagementPolicyAssignments; + +public final class RoleManagementPolicyAssignmentsImpl implements RoleManagementPolicyAssignments { + private static final ClientLogger LOGGER = new ClientLogger(RoleManagementPolicyAssignmentsImpl.class); + + private final RoleManagementPolicyAssignmentsClient innerClient; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + public RoleManagementPolicyAssignmentsImpl( + RoleManagementPolicyAssignmentsClient innerClient, + com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String scope, String roleManagementPolicyAssignmentName, Context context) { + Response inner = + this.serviceClient().getWithResponse(scope, roleManagementPolicyAssignmentName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RoleManagementPolicyAssignmentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RoleManagementPolicyAssignment get(String scope, String roleManagementPolicyAssignmentName) { + RoleManagementPolicyAssignmentInner inner = this.serviceClient().get(scope, roleManagementPolicyAssignmentName); + if (inner != null) { + return new RoleManagementPolicyAssignmentImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteByResourceGroupWithResponse( + String scope, String roleManagementPolicyAssignmentName, Context context) { + return this.serviceClient().deleteWithResponse(scope, roleManagementPolicyAssignmentName, context); + } + + public void deleteByResourceGroup(String scope, String roleManagementPolicyAssignmentName) { + this.serviceClient().delete(scope, roleManagementPolicyAssignmentName); + } + + public PagedIterable listForScope(String scope) { + PagedIterable inner = this.serviceClient().listForScope(scope); + return Utils.mapPage(inner, inner1 -> new RoleManagementPolicyAssignmentImpl(inner1, this.manager())); + } + + public PagedIterable listForScope(String scope, Context context) { + PagedIterable inner = this.serviceClient().listForScope(scope, context); + return Utils.mapPage(inner, inner1 -> new RoleManagementPolicyAssignmentImpl(inner1, this.manager())); + } + + public RoleManagementPolicyAssignment getById(String id) { + String scope = + Utils + .getValueFromIdByParameterName( + id, + "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}", + "scope"); + if (scope == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); + } + String roleManagementPolicyAssignmentName = + Utils + .getValueFromIdByParameterName( + id, + "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}", + "roleManagementPolicyAssignmentName"); + if (roleManagementPolicyAssignmentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'roleManagementPolicyAssignments'.", + id))); + } + return this.getWithResponse(scope, roleManagementPolicyAssignmentName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String scope = + Utils + .getValueFromIdByParameterName( + id, + "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}", + "scope"); + if (scope == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); + } + String roleManagementPolicyAssignmentName = + Utils + .getValueFromIdByParameterName( + id, + "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}", + "roleManagementPolicyAssignmentName"); + if (roleManagementPolicyAssignmentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'roleManagementPolicyAssignments'.", + id))); + } + return this.getWithResponse(scope, roleManagementPolicyAssignmentName, context); + } + + public void deleteById(String id) { + String scope = + Utils + .getValueFromIdByParameterName( + id, + "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}", + "scope"); + if (scope == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); + } + String roleManagementPolicyAssignmentName = + Utils + .getValueFromIdByParameterName( + id, + "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}", + "roleManagementPolicyAssignmentName"); + if (roleManagementPolicyAssignmentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'roleManagementPolicyAssignments'.", + id))); + } + this.deleteByResourceGroupWithResponse(scope, roleManagementPolicyAssignmentName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String scope = + Utils + .getValueFromIdByParameterName( + id, + "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}", + "scope"); + if (scope == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); + } + String roleManagementPolicyAssignmentName = + Utils + .getValueFromIdByParameterName( + id, + "/{scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments/{roleManagementPolicyAssignmentName}", + "roleManagementPolicyAssignmentName"); + if (roleManagementPolicyAssignmentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'roleManagementPolicyAssignments'.", + id))); + } + return this.deleteByResourceGroupWithResponse(scope, roleManagementPolicyAssignmentName, context); + } + + private RoleManagementPolicyAssignmentsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.authorization.generated.AuthorizationManager manager() { + return this.serviceManager; + } + + public RoleManagementPolicyAssignmentImpl define(String name) { + return new RoleManagementPolicyAssignmentImpl(name, this.manager()); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleManagementPolicyImpl.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleManagementPolicyImpl.java new file mode 100644 index 000000000000..1d7d1b2726ab --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/RoleManagementPolicyImpl.java @@ -0,0 +1,93 @@ +// 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.RoleManagementPolicyInner; +import com.azure.resourcemanager.authorization.generated.models.PolicyProperties; +import com.azure.resourcemanager.authorization.generated.models.Principal; +import com.azure.resourcemanager.authorization.generated.models.RoleManagementPolicy; +import com.azure.resourcemanager.authorization.generated.models.RoleManagementPolicyRule; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class RoleManagementPolicyImpl implements RoleManagementPolicy { + private RoleManagementPolicyInner innerObject; + + private final com.azure.resourcemanager.authorization.generated.AuthorizationManager serviceManager; + + RoleManagementPolicyImpl( + RoleManagementPolicyInner 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 scope() { + return this.innerModel().scope(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public String description() { + return this.innerModel().description(); + } + + public Boolean isOrganizationDefault() { + return this.innerModel().isOrganizationDefault(); + } + + public Principal lastModifiedBy() { + return this.innerModel().lastModifiedBy(); + } + + public OffsetDateTime lastModifiedDateTime() { + return this.innerModel().lastModifiedDateTime(); + } + + public List rules() { + List inner = this.innerModel().rules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List effectiveRules() { + List inner = this.innerModel().effectiveRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PolicyProperties policyProperties() { + return this.innerModel().policyProperties(); + } + + public RoleManagementPolicyInner 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/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 000000000000..7e2b7844ceba --- /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") + public 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), scope, apiVersion, 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), scope, apiVersion, 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. + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 getWithResponse(scope, Context.NONE).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 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.put(this.client.getEndpoint(), scope, apiVersion, 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.put(this.client.getEndpoint(), scope, apiVersion, 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. + * @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(); + } + + /** + * 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 putWithResponse(scope, properties, Context.NONE).getValue(); + } +} 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 000000000000..f9159b8e13c4 --- /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 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 get(String scope) { + AccessReviewDefaultSettingsInner inner = this.serviceClient().get(scope); + 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; + } + } + + 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; + } + } + + 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 000000000000..a28193f729ac --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewHistoryDefinitionInstancesClientImpl.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.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") + public 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .generateDownloadUri( + this.client.getEndpoint(), + scope, + historyDefinitionId, + instanceId, + apiVersion, + 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .generateDownloadUri( + this.client.getEndpoint(), scope, historyDefinitionId, instanceId, apiVersion, 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. + * @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(); + } + + /** + * 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 generateDownloadUriWithResponse(scope, historyDefinitionId, instanceId, Context.NONE).getValue(); + } +} 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 000000000000..0f9f1933f575 --- /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 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; + } + } + + 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; + } + } + + 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 000000000000..26cd3bbd1766 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewHistoryDefinitionInstancesOperationsClientImpl.java @@ -0,0 +1,325 @@ +// 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") + public 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service.list(this.client.getEndpoint(), scope, historyDefinitionId, apiVersion, 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), scope, historyDefinitionId, apiVersion, 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 000000000000..4db2f32cb640 --- /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 000000000000..7a70cf46e9f1 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewHistoryDefinitionOperationsClientImpl.java @@ -0,0 +1,346 @@ +// 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") + public 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + scope, + historyDefinitionId, + apiVersion, + 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create(this.client.getEndpoint(), scope, historyDefinitionId, apiVersion, 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. + * @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(); + } + + /** + * 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 createWithResponse(scope, historyDefinitionId, properties, Context.NONE).getValue(); + } + + /** + * 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteById(this.client.getEndpoint(), scope, historyDefinitionId, apiVersion, 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.deleteById(this.client.getEndpoint(), scope, historyDefinitionId, apiVersion, 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. + * @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(); + } + + /** + * 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) { + deleteByIdWithResponse(scope, historyDefinitionId, Context.NONE); + } +} 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 000000000000..748e9049fe6e --- /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 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 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 deleteByIdWithResponse(String scope, String historyDefinitionId, Context context) { + return this.serviceClient().deleteByIdWithResponse(scope, historyDefinitionId, context); + } + + public void deleteById(String scope, String historyDefinitionId) { + this.serviceClient().deleteById(scope, historyDefinitionId); + } + + 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 000000000000..4f77580bce36 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewHistoryDefinitionsClientImpl.java @@ -0,0 +1,460 @@ +// 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") + public 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), scope, apiVersion, 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), scope, apiVersion, 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service.getById(this.client.getEndpoint(), scope, historyDefinitionId, apiVersion, 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getById(this.client.getEndpoint(), scope, historyDefinitionId, apiVersion, 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. + * @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 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 getByIdWithResponse(scope, historyDefinitionId, Context.NONE).getValue(); + } + + /** + * 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 000000000000..8fc1f2ff78d9 --- /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 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; + } + } + + 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; + } + } + + 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 000000000000..b62eb079ea14 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewInstanceContactedReviewersClientImpl.java @@ -0,0 +1,339 @@ +// 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") + public 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), scope, scheduleDefinitionId, id, apiVersion, 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), scope, scheduleDefinitionId, id, apiVersion, 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 000000000000..159ea75baddd --- /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 000000000000..0dd44132f983 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewInstanceDecisionsClientImpl.java @@ -0,0 +1,379 @@ +// 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") + public 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + scope, + scheduleDefinitionId, + id, + apiVersion, + 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), scope, scheduleDefinitionId, id, apiVersion, 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 000000000000..4a9af27f11d7 --- /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 000000000000..524079a15994 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewInstanceOperationsClientImpl.java @@ -0,0 +1,799 @@ +// 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") + public 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .stop(this.client.getEndpoint(), scope, scheduleDefinitionId, id, apiVersion, 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.stop(this.client.getEndpoint(), scope, scheduleDefinitionId, id, apiVersion, 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. + * @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 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) { + stopWithResponse(scope, scheduleDefinitionId, id, Context.NONE); + } + + /** + * 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .recordAllDecisions( + this.client.getEndpoint(), + scope, + scheduleDefinitionId, + id, + apiVersion, + 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .recordAllDecisions( + this.client.getEndpoint(), scope, scheduleDefinitionId, id, apiVersion, 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. + * @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 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) { + recordAllDecisionsWithResponse(scope, scheduleDefinitionId, id, properties, Context.NONE); + } + + /** + * 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .resetDecisions( + this.client.getEndpoint(), scope, scheduleDefinitionId, id, apiVersion, 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .resetDecisions(this.client.getEndpoint(), scope, scheduleDefinitionId, id, apiVersion, 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. + * @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 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) { + resetDecisionsWithResponse(scope, scheduleDefinitionId, id, Context.NONE); + } + + /** + * 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .applyDecisions( + this.client.getEndpoint(), scope, scheduleDefinitionId, id, apiVersion, 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .applyDecisions(this.client.getEndpoint(), scope, scheduleDefinitionId, id, apiVersion, 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. + * @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 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) { + applyDecisionsWithResponse(scope, scheduleDefinitionId, id, Context.NONE); + } + + /** + * 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .sendReminders( + this.client.getEndpoint(), scope, scheduleDefinitionId, id, apiVersion, 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .sendReminders(this.client.getEndpoint(), scope, scheduleDefinitionId, id, apiVersion, 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. + * @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(); + } + + /** + * 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) { + sendRemindersWithResponse(scope, scheduleDefinitionId, id, Context.NONE); + } +} 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 000000000000..978f76c595f4 --- /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 Response stopWithResponse(String scope, String scheduleDefinitionId, String id, Context context) { + return this.serviceClient().stopWithResponse(scope, scheduleDefinitionId, id, context); + } + + public void stop(String scope, String scheduleDefinitionId, String id) { + this.serviceClient().stop(scope, scheduleDefinitionId, id); + } + + public Response recordAllDecisionsWithResponse( + String scope, + String scheduleDefinitionId, + String id, + RecordAllDecisionsProperties properties, + Context context) { + return this + .serviceClient() + .recordAllDecisionsWithResponse(scope, scheduleDefinitionId, id, properties, context); + } + + public void recordAllDecisions( + String scope, String scheduleDefinitionId, String id, RecordAllDecisionsProperties properties) { + this.serviceClient().recordAllDecisions(scope, scheduleDefinitionId, id, properties); + } + + public Response resetDecisionsWithResponse( + String scope, String scheduleDefinitionId, String id, Context context) { + return this.serviceClient().resetDecisionsWithResponse(scope, scheduleDefinitionId, id, context); + } + + public void resetDecisions(String scope, String scheduleDefinitionId, String id) { + this.serviceClient().resetDecisions(scope, scheduleDefinitionId, id); + } + + public Response applyDecisionsWithResponse( + String scope, String scheduleDefinitionId, String id, Context context) { + return this.serviceClient().applyDecisionsWithResponse(scope, scheduleDefinitionId, id, context); + } + + public void applyDecisions(String scope, String scheduleDefinitionId, String id) { + this.serviceClient().applyDecisions(scope, scheduleDefinitionId, id); + } + + public Response sendRemindersWithResponse( + String scope, String scheduleDefinitionId, String id, Context context) { + return this.serviceClient().sendRemindersWithResponse(scope, scheduleDefinitionId, id, context); + } + + public void sendReminders(String scope, String scheduleDefinitionId, String id) { + this.serviceClient().sendReminders(scope, scheduleDefinitionId, id); + } + + 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 000000000000..a17543b3744e --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewInstancesClientImpl.java @@ -0,0 +1,681 @@ +// 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") + public 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + scope, + scheduleDefinitionId, + apiVersion, + 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), scope, scheduleDefinitionId, apiVersion, 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getById( + this.client.getEndpoint(), scope, scheduleDefinitionId, id, apiVersion, 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getById(this.client.getEndpoint(), scope, scheduleDefinitionId, id, apiVersion, 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. + * @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(); + } + + /** + * 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 getByIdWithResponse(scope, scheduleDefinitionId, id, Context.NONE).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 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + scope, + scheduleDefinitionId, + id, + apiVersion, + 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), scope, scheduleDefinitionId, id, apiVersion, 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. + * @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(); + } + + /** + * 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 createWithResponse(scope, scheduleDefinitionId, id, properties, Context.NONE).getValue(); + } + + /** + * 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 000000000000..3fe30c15c228 --- /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 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 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 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; + } + } + + 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; + } + } + + 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 000000000000..3145144cd2f7 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/ScopeAccessReviewScheduleDefinitionsClientImpl.java @@ -0,0 +1,875 @@ +// 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") + public 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), scope, apiVersion, 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), scope, apiVersion, 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getById(this.client.getEndpoint(), scope, scheduleDefinitionId, apiVersion, 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getById(this.client.getEndpoint(), scope, scheduleDefinitionId, apiVersion, 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. + * @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(); + } + + /** + * 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 getByIdWithResponse(scope, scheduleDefinitionId, Context.NONE).getValue(); + } + + /** + * 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteById( + this.client.getEndpoint(), scope, scheduleDefinitionId, apiVersion, 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.deleteById(this.client.getEndpoint(), scope, scheduleDefinitionId, apiVersion, 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. + * @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(); + } + + /** + * 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) { + deleteByIdWithResponse(scope, scheduleDefinitionId, Context.NONE); + } + + /** + * 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdateById( + this.client.getEndpoint(), + scope, + scheduleDefinitionId, + apiVersion, + 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdateById( + this.client.getEndpoint(), scope, scheduleDefinitionId, apiVersion, 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. + * @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(); + } + + /** + * 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 createOrUpdateByIdWithResponse(scope, scheduleDefinitionId, properties, Context.NONE).getValue(); + } + + /** + * 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service.stop(this.client.getEndpoint(), scope, scheduleDefinitionId, apiVersion, 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.stop(this.client.getEndpoint(), scope, scheduleDefinitionId, apiVersion, 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. + * @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(); + } + + /** + * 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) { + stopWithResponse(scope, scheduleDefinitionId, Context.NONE); + } + + /** + * 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 000000000000..c88f43201e2c --- /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 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 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 deleteByIdWithResponse(String scope, String scheduleDefinitionId, Context context) { + return this.serviceClient().deleteByIdWithResponse(scope, scheduleDefinitionId, context); + } + + public void deleteById(String scope, String scheduleDefinitionId) { + this.serviceClient().deleteById(scope, scheduleDefinitionId); + } + + 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 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 stopWithResponse(String scope, String scheduleDefinitionId, Context context) { + return this.serviceClient().stopWithResponse(scope, scheduleDefinitionId, context); + } + + public void stop(String scope, String scheduleDefinitionId) { + this.serviceClient().stop(scope, scheduleDefinitionId); + } + + 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 000000000000..3a83330c3fb0 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/TenantLevelAccessReviewInstanceContactedReviewersClientImpl.java @@ -0,0 +1,323 @@ +// 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") + public 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service.list(this.client.getEndpoint(), scheduleDefinitionId, id, apiVersion, 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 apiVersion = "2021-12-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), scheduleDefinitionId, id, apiVersion, 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 000000000000..7d2b85d1ab33 --- /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 000000000000..9ee144b3a988 --- /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 000000000000..f818d26e6e69 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/implementation/package-info.java @@ -0,0 +1,11 @@ +// 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. Role based access control provides you a + * way to apply granular level policy administration down to individual resources or resource groups. These operations + * enable you to manage role definitions and role assignments. A role definition describes the set of actions that can + * be performed on resources. A role assignment grants access to Azure Active Directory users. + */ +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 000000000000..ae6aec980c06 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessRecommendationType.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.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 a new instance of AccessRecommendationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AccessRecommendationType() { + } + + /** + * 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 000000000000..9dc1fd17761a --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewActorIdentityType.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. */ +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 a new instance of AccessReviewActorIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AccessReviewActorIdentityType() { + } + + /** + * 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 000000000000..e45410fb99ce --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewApplyResult.java @@ -0,0 +1,60 @@ +// 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 a new instance of AccessReviewApplyResult value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AccessReviewApplyResult() { + } + + /** + * 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 000000000000..2409391d1264 --- /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 000000000000..45c6d810590f --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewContactedReviewerListResult.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.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; + + /** Creates an instance of AccessReviewContactedReviewerListResult class. */ + public AccessReviewContactedReviewerListResult() { + } + + /** + * 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 000000000000..66e7f1c3cd4b --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecision.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.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 principal property: Principal associated with the decision record. Can be + * AccessReviewDecisionUserIdentity or AccessReviewDecisionServicePrincipalIdentity. + * + * @return the principal value. + */ + AccessReviewDecisionIdentity principal(); + + /** + * 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 typePropertiesType property: The type of resource. + * + * @return the typePropertiesType value. + */ + DecisionResourceType typePropertiesType(); + + /** + * Gets the idPropertiesId property: The id of resource associated with a decision record. + * + * @return the idPropertiesId value. + */ + String idPropertiesId(); + + /** + * Gets the displayName property: The display name of resource associated with a decision record. + * + * @return the displayName value. + */ + String displayName(); + + /** + * 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/AccessReviewDecisionIdentity.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionIdentity.java new file mode 100644 index 000000000000..a36b8ef424fd --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionIdentity.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.models; + +import com.azure.core.annotation.Immutable; +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; + + /** Creates an instance of AccessReviewDecisionIdentity class. */ + public AccessReviewDecisionIdentity() { + } + + /** + * 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/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 000000000000..4929ed5e064f --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionInsight.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +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 properties; + + /** Creates an instance of AccessReviewDecisionInsight class. */ + public AccessReviewDecisionInsight() { + } + + /** + * Get the properties property: Access Review Decision Insight properties. + * + * @return the properties value. + */ + public AccessReviewDecisionInsightProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Access Review Decision Insight properties. + * + * @param properties the properties value to set. + * @return the AccessReviewDecisionInsight object itself. + */ + public AccessReviewDecisionInsight withProperties(AccessReviewDecisionInsightProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionInsightProperties.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionInsightProperties.java new file mode 100644 index 000000000000..29bb64ac55ae --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionInsightProperties.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.annotation.Immutable; +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; + + /** Creates an instance of AccessReviewDecisionInsightProperties class. */ + public AccessReviewDecisionInsightProperties() { + } + + /** + * 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/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 000000000000..ef089977d325 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionInsightType.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.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 a new instance of AccessReviewDecisionInsightType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AccessReviewDecisionInsightType() { + } + + /** + * 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 000000000000..be30018af30f --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionListResult.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.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; + + /** Creates an instance of AccessReviewDecisionListResult class. */ + public AccessReviewDecisionListResult() { + } + + /** + * 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 000000000000..7c15cb1c99c2 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionPrincipalResourceMembershipType.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; + +/** 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 a new instance of AccessReviewDecisionPrincipalResourceMembershipType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AccessReviewDecisionPrincipalResourceMembershipType() { + } + + /** + * 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 000000000000..6434f8f82c72 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionServicePrincipalIdentity.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.annotation.Immutable; +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 final class AccessReviewDecisionServicePrincipalIdentity extends AccessReviewDecisionIdentity { + /* + * The appId for the service principal entity being reviewed + */ + @JsonProperty(value = "appId", access = JsonProperty.Access.WRITE_ONLY) + private String appId; + + /** Creates an instance of AccessReviewDecisionServicePrincipalIdentity class. */ + public AccessReviewDecisionServicePrincipalIdentity() { + } + + /** + * 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 000000000000..ba76adc0af71 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionUserIdentity.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.annotation.Immutable; +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 final 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; + + /** Creates an instance of AccessReviewDecisionUserIdentity class. */ + public AccessReviewDecisionUserIdentity() { + } + + /** + * 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 000000000000..3616f46ec130 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewDecisionUserSignInInsightProperties.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.annotation.Immutable; +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; + + /** Creates an instance of AccessReviewDecisionUserSignInInsightProperties class. */ + public AccessReviewDecisionUserSignInInsightProperties() { + } + + /** + * 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 000000000000..585349712358 --- /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 000000000000..c7ba05a9e274 --- /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. + * + * @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. + * + * @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 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); + + /** + * 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); +} 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 000000000000..17f341df1ec4 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryDefinition.java @@ -0,0 +1,342 @@ +// 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 000000000000..5f3d0e07711a --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryDefinitionInstanceListResult.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.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; + + /** Creates an instance of AccessReviewHistoryDefinitionInstanceListResult class. */ + public AccessReviewHistoryDefinitionInstanceListResult() { + } + + /** + * 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 000000000000..5613c0e8ad3d --- /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. + * @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); + + /** + * 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); +} 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 000000000000..0c43e986409b --- /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 000000000000..0d3225e4456c --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryDefinitionListResult.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.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; + + /** Creates an instance of AccessReviewHistoryDefinitionListResult class. */ + public AccessReviewHistoryDefinitionListResult() { + } + + /** + * 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 000000000000..20af817db744 --- /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. + * @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); + + /** + * 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); + + /** + * 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 000000000000..da06ea19832e --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewHistoryDefinitionStatus.java @@ -0,0 +1,57 @@ +// 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 a new instance of AccessReviewHistoryDefinitionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AccessReviewHistoryDefinitionStatus() { + } + + /** + * 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 000000000000..fff89c61103f --- /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. + * @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); + + /** + * 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); +} 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 000000000000..61e237b195f8 --- /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 000000000000..98baf28e6332 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstance.java @@ -0,0 +1,192 @@ +// 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 000000000000..80a944224d7d --- /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 000000000000..d8a236a4bc2f --- /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 000000000000..f1cbe393cecd --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstanceListResult.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.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; + + /** Creates an instance of AccessReviewInstanceListResult class. */ + public AccessReviewInstanceListResult() { + } + + /** + * 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 000000000000..35851ca0de42 --- /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. + * @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); + + /** + * 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); + + /** + * 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); + + /** + * 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); +} 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 000000000000..3bfd1de5c702 --- /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. + * @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 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 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 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 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 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 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 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 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); + + /** + * 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); +} 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 000000000000..ba7c1b52dfa1 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstanceReviewersType.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.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 a new instance of AccessReviewInstanceReviewersType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AccessReviewInstanceReviewersType() { + } + + /** + * 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 000000000000..56a2b732b202 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewInstanceStatus.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.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 a new instance of AccessReviewInstanceStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AccessReviewInstanceStatus() { + } + + /** + * 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 000000000000..89b4c7776b43 --- /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. + * @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); + + /** + * 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); + + /** + * 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 000000000000..06e4d6f4bcaf --- /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. + * @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); + + /** + * 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); +} 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 000000000000..06b52a3af4fd --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewRecurrencePatternType.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 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 a new instance of AccessReviewRecurrencePatternType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AccessReviewRecurrencePatternType() { + } + + /** + * 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 000000000000..2cdc7f7c7660 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewRecurrenceRangeType.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.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 a new instance of AccessReviewRecurrenceRangeType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AccessReviewRecurrenceRangeType() { + } + + /** + * 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 000000000000..29bee33258b4 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewResult.java @@ -0,0 +1,56 @@ +// 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 a new instance of AccessReviewResult value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AccessReviewResult() { + } + + /** + * 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 000000000000..2622e0d2dedc --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewReviewer.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.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; + + /** Creates an instance of AccessReviewReviewer class. */ + public AccessReviewReviewer() { + } + + /** + * 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 000000000000..c38f1278744a --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewReviewerType.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. */ +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 a new instance of AccessReviewReviewerType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AccessReviewReviewerType() { + } + + /** + * 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 000000000000..03d02f5d5da9 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewScheduleDefinition.java @@ -0,0 +1,1010 @@ +// 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. + * + * @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); + + /** + * 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(); +} 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 000000000000..51d0bec90e91 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewScheduleDefinitionListResult.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.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; + + /** Creates an instance of AccessReviewScheduleDefinitionListResult class. */ + public AccessReviewScheduleDefinitionListResult() { + } + + /** + * 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 000000000000..66bea6cfc1d4 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewScheduleDefinitionReviewersType.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.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 a new instance of AccessReviewScheduleDefinitionReviewersType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AccessReviewScheduleDefinitionReviewersType() { + } + + /** + * 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 000000000000..d7387350dca3 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewScheduleDefinitionStatus.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.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 a new instance of AccessReviewScheduleDefinitionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AccessReviewScheduleDefinitionStatus() { + } + + /** + * 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 000000000000..5843844269bc --- /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. + * @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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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 000000000000..f79fe8ba36e3 --- /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 000000000000..70a6447722ca --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewScopeAssignmentState.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 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 a new instance of AccessReviewScopeAssignmentState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AccessReviewScopeAssignmentState() { + } + + /** + * 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 000000000000..a95e1cf2b6eb --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AccessReviewScopePrincipalType.java @@ -0,0 +1,56 @@ +// 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 a new instance of AccessReviewScopePrincipalType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AccessReviewScopePrincipalType() { + } + + /** + * 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/Alert.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/Alert.java new file mode 100644 index 000000000000..96cf22c75b18 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/Alert.java @@ -0,0 +1,97 @@ +// 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.AlertInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of Alert. */ +public interface Alert { + /** + * Gets the id property: The alert ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The alert name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The alert type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the scope property: The alert scope. + * + * @return the scope value. + */ + String scope(); + + /** + * Gets the isActive property: False by default; true if the alert is active. + * + * @return the isActive value. + */ + Boolean isActive(); + + /** + * Gets the incidentCount property: The number of generated incidents of the alert. + * + * @return the incidentCount value. + */ + Integer incidentCount(); + + /** + * Gets the lastModifiedDateTime property: The date time when the alert configuration was updated or new incidents + * were generated. + * + * @return the lastModifiedDateTime value. + */ + OffsetDateTime lastModifiedDateTime(); + + /** + * Gets the lastScannedDateTime property: The date time when the alert was last scanned. + * + * @return the lastScannedDateTime value. + */ + OffsetDateTime lastScannedDateTime(); + + /** + * Gets the alertDefinition property: The alert definition. + * + * @return the alertDefinition value. + */ + AlertDefinition alertDefinition(); + + /** + * Gets the alertIncidents property: The alert incidents. + * + * @return the alertIncidents value. + */ + List alertIncidents(); + + /** + * Gets the alertConfiguration property: The alert configuration. + * + * @return the alertConfiguration value. + */ + AlertConfiguration alertConfiguration(); + + /** + * Gets the inner com.azure.resourcemanager.authorization.generated.fluent.models.AlertInner object. + * + * @return the inner object. + */ + AlertInner innerModel(); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertConfiguration.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertConfiguration.java new file mode 100644 index 000000000000..1f758eb6760e --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertConfiguration.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.AlertConfigurationInner; + +/** An immutable client-side representation of AlertConfiguration. */ +public interface AlertConfiguration { + /** + * Gets the id property: The alert configuration ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The alert configuration name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The alert configuration type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: Alert configuration properties. + * + * @return the properties value. + */ + AlertConfigurationProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.authorization.generated.fluent.models.AlertConfigurationInner object. + * + * @return the inner object. + */ + AlertConfigurationInner innerModel(); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertConfigurationListResult.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertConfigurationListResult.java new file mode 100644 index 000000000000..00a748ade71a --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertConfigurationListResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.authorization.generated.fluent.models.AlertConfigurationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Alert configuration list operation result. */ +@Fluent +public final class AlertConfigurationListResult { + /* + * Alert configuration list + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of AlertConfigurationListResult class. */ + public AlertConfigurationListResult() { + } + + /** + * Get the value property: Alert configuration list. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Alert configuration list. + * + * @param value the value value to set. + * @return the AlertConfigurationListResult object itself. + */ + public AlertConfigurationListResult 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 AlertConfigurationListResult object itself. + */ + public AlertConfigurationListResult 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/AlertConfigurationProperties.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertConfigurationProperties.java new file mode 100644 index 000000000000..9e574cb1ad9a --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertConfigurationProperties.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.resourcemanager.authorization.generated.fluent.models.AlertConfigurationPropertiesInner; + +/** An immutable client-side representation of AlertConfigurationProperties. */ +public interface AlertConfigurationProperties { + /** + * Gets the alertDefinitionId property: The alert definition ID. + * + * @return the alertDefinitionId value. + */ + String alertDefinitionId(); + + /** + * Gets the scope property: The alert scope. + * + * @return the scope value. + */ + String scope(); + + /** + * Gets the isEnabled property: True if the alert is enabled, false will disable the scanning for the specific + * alert. + * + * @return the isEnabled value. + */ + Boolean isEnabled(); + + /** + * Gets the alertDefinition property: The alert definition. + * + * @return the alertDefinition value. + */ + AlertDefinition alertDefinition(); + + /** + * Gets the inner com.azure.resourcemanager.authorization.generated.fluent.models.AlertConfigurationPropertiesInner + * object. + * + * @return the inner object. + */ + AlertConfigurationPropertiesInner innerModel(); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertConfigurations.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertConfigurations.java new file mode 100644 index 000000000000..a516a4cc24e0 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertConfigurations.java @@ -0,0 +1,98 @@ +// 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.AlertConfigurationInner; + +/** Resource collection API of AlertConfigurations. */ +public interface AlertConfigurations { + /** + * Get the specified alert configuration. + * + * @param scope The scope of the alert configuration. The scope can be any REST resource instance. For example, use + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param alertId The name of the alert configuration to get. + * @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 specified alert configuration along with {@link Response}. + */ + Response getWithResponse(String scope, String alertId, Context context); + + /** + * Get the specified alert configuration. + * + * @param scope The scope of the alert configuration. The scope can be any REST resource instance. For example, use + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param alertId The name of the alert configuration to get. + * @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 specified alert configuration. + */ + AlertConfiguration get(String scope, String alertId); + + /** + * Update an alert configuration. + * + * @param scope The scope of the alert configuration. + * @param alertId The name of the alert configuration to update. + * @param parameters Parameters for the alert configuration. + * @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 updateWithResponse( + String scope, String alertId, AlertConfigurationInner parameters, Context context); + + /** + * Update an alert configuration. + * + * @param scope The scope of the alert configuration. + * @param alertId The name of the alert configuration to update. + * @param parameters Parameters for the alert configuration. + * @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 update(String scope, String alertId, AlertConfigurationInner parameters); + + /** + * Gets alert configurations for a resource scope. + * + * @param scope The scope of the alert configuration. + * @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 alert configurations for a resource scope as paginated response with {@link PagedIterable}. + */ + PagedIterable listForScope(String scope); + + /** + * Gets alert configurations for a resource scope. + * + * @param scope The scope of the alert configuration. + * @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 alert configurations for a resource scope as paginated response with {@link PagedIterable}. + */ + PagedIterable listForScope(String scope, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertDefinition.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertDefinition.java new file mode 100644 index 000000000000..0a23d1634a66 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertDefinition.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.models; + +import com.azure.resourcemanager.authorization.generated.fluent.models.AlertDefinitionInner; + +/** An immutable client-side representation of AlertDefinition. */ +public interface AlertDefinition { + /** + * Gets the id property: The alert definition ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The alert definition name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The alert definition type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the displayName property: The alert display name. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the scope property: The alert scope. + * + * @return the scope value. + */ + String scope(); + + /** + * Gets the description property: The alert description. + * + * @return the description value. + */ + String description(); + + /** + * Gets the severityLevel property: Severity level of the alert. + * + * @return the severityLevel value. + */ + SeverityLevel severityLevel(); + + /** + * Gets the securityImpact property: Security impact of the alert. + * + * @return the securityImpact value. + */ + String securityImpact(); + + /** + * Gets the mitigationSteps property: The methods to mitigate the alert. + * + * @return the mitigationSteps value. + */ + String mitigationSteps(); + + /** + * Gets the howToPrevent property: The ways to prevent the alert. + * + * @return the howToPrevent value. + */ + String howToPrevent(); + + /** + * Gets the isRemediatable property: True if the alert can be remediated; false, otherwise. + * + * @return the isRemediatable value. + */ + Boolean isRemediatable(); + + /** + * Gets the isConfigurable property: True if the alert configuration can be configured; false, otherwise. + * + * @return the isConfigurable value. + */ + Boolean isConfigurable(); + + /** + * Gets the inner com.azure.resourcemanager.authorization.generated.fluent.models.AlertDefinitionInner object. + * + * @return the inner object. + */ + AlertDefinitionInner innerModel(); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertDefinitionListResult.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertDefinitionListResult.java new file mode 100644 index 000000000000..8d6bd6534c13 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertDefinitionListResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.authorization.generated.fluent.models.AlertDefinitionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Alert definition list operation result. */ +@Fluent +public final class AlertDefinitionListResult { + /* + * Alert 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; + + /** Creates an instance of AlertDefinitionListResult class. */ + public AlertDefinitionListResult() { + } + + /** + * Get the value property: Alert definition list. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Alert definition list. + * + * @param value the value value to set. + * @return the AlertDefinitionListResult object itself. + */ + public AlertDefinitionListResult 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 AlertDefinitionListResult object itself. + */ + public AlertDefinitionListResult 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/AlertDefinitions.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertDefinitions.java new file mode 100644 index 000000000000..27299576ea69 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertDefinitions.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.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 AlertDefinitions. */ +public interface AlertDefinitions { + /** + * Get the specified alert definition. + * + * @param scope The scope of the alert definition. The scope can be any REST resource instance. For example, use + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param alertDefinitionId The name of the alert definition to get. + * @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 specified alert definition along with {@link Response}. + */ + Response getWithResponse(String scope, String alertDefinitionId, Context context); + + /** + * Get the specified alert definition. + * + * @param scope The scope of the alert definition. The scope can be any REST resource instance. For example, use + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param alertDefinitionId The name of the alert definition to get. + * @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 specified alert definition. + */ + AlertDefinition get(String scope, String alertDefinitionId); + + /** + * Gets alert definitions for a resource scope. + * + * @param scope The scope of the alert 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 alert definitions for a resource scope as paginated response with {@link PagedIterable}. + */ + PagedIterable listForScope(String scope); + + /** + * Gets alert definitions for a resource scope. + * + * @param scope The scope of the alert 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 alert definitions for a resource scope as paginated response with {@link PagedIterable}. + */ + PagedIterable listForScope(String scope, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertIncident.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertIncident.java new file mode 100644 index 000000000000..6ae7259efc91 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertIncident.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.AlertIncidentInner; + +/** An immutable client-side representation of AlertIncident. */ +public interface AlertIncident { + /** + * Gets the id property: The alert incident ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The alert incident name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The alert incident type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: Alert incident properties. + * + * @return the properties value. + */ + AlertIncidentProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.authorization.generated.fluent.models.AlertIncidentInner object. + * + * @return the inner object. + */ + AlertIncidentInner innerModel(); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertIncidentListResult.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertIncidentListResult.java new file mode 100644 index 000000000000..82cc13724429 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertIncidentListResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.authorization.generated.fluent.models.AlertIncidentInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Alert incident list operation result. */ +@Fluent +public final class AlertIncidentListResult { + /* + * Alert incident list + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of AlertIncidentListResult class. */ + public AlertIncidentListResult() { + } + + /** + * Get the value property: Alert incident list. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Alert incident list. + * + * @param value the value value to set. + * @return the AlertIncidentListResult object itself. + */ + public AlertIncidentListResult 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 AlertIncidentListResult object itself. + */ + public AlertIncidentListResult 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/AlertIncidentProperties.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertIncidentProperties.java new file mode 100644 index 000000000000..4ba6fad64c01 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertIncidentProperties.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.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Alert incident properties. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "alertIncidentType", + defaultImpl = AlertIncidentProperties.class) +@JsonTypeName("AlertIncidentProperties") +@JsonSubTypes({ + @JsonSubTypes.Type( + name = "AzureRolesAssignedOutsidePimAlertIncident", + value = AzureRolesAssignedOutsidePimAlertIncidentProperties.class), + @JsonSubTypes.Type( + name = "DuplicateRoleCreatedAlertIncident", + value = DuplicateRoleCreatedAlertIncidentProperties.class), + @JsonSubTypes.Type( + name = "TooManyOwnersAssignedToResourceAlertIncident", + value = TooManyOwnersAssignedToResourceAlertIncidentProperties.class), + @JsonSubTypes.Type( + name = "TooManyPermanentOwnersAssignedToResourceAlertIncident", + value = TooManyPermanentOwnersAssignedToResourceAlertIncidentProperties.class) +}) +@Immutable +public class AlertIncidentProperties { + /** Creates an instance of AlertIncidentProperties class. */ + public AlertIncidentProperties() { + } + + /** + * 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/AlertIncidents.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertIncidents.java new file mode 100644 index 000000000000..0d97e6d5ee0c --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertIncidents.java @@ -0,0 +1,100 @@ +// 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 AlertIncidents. */ +public interface AlertIncidents { + /** + * Get the specified alert incident. + * + * @param scope The scope of the alert incident. The scope can be any REST resource instance. For example, use + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param alertId The name of the alert. + * @param alertIncidentId The name of the alert incident to get. + * @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 specified alert incident along with {@link Response}. + */ + Response getWithResponse(String scope, String alertId, String alertIncidentId, Context context); + + /** + * Get the specified alert incident. + * + * @param scope The scope of the alert incident. The scope can be any REST resource instance. For example, use + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param alertId The name of the alert. + * @param alertIncidentId The name of the alert incident to get. + * @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 specified alert incident. + */ + AlertIncident get(String scope, String alertId, String alertIncidentId); + + /** + * Gets alert incidents for a resource scope. + * + * @param scope The scope of the alert incident. + * @param alertId The name of the alert. + * @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 alert incidents for a resource scope as paginated response with {@link PagedIterable}. + */ + PagedIterable listForScope(String scope, String alertId); + + /** + * Gets alert incidents for a resource scope. + * + * @param scope The scope of the alert incident. + * @param alertId The name of the alert. + * @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 alert incidents for a resource scope as paginated response with {@link PagedIterable}. + */ + PagedIterable listForScope(String scope, String alertId, Context context); + + /** + * Remediate an alert incident. + * + * @param scope The scope of the alert incident. + * @param alertId The name of the alert. + * @param alertIncidentId The name of the alert incident to remediate. + * @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 remediateWithResponse(String scope, String alertId, String alertIncidentId, Context context); + + /** + * Remediate an alert incident. + * + * @param scope The scope of the alert incident. + * @param alertId The name of the alert. + * @param alertIncidentId The name of the alert incident to remediate. + * @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 remediate(String scope, String alertId, String alertIncidentId); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertListResult.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertListResult.java new file mode 100644 index 000000000000..8177647d081a --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertListResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.authorization.generated.fluent.models.AlertInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Alert list operation result. */ +@Fluent +public final class AlertListResult { + /* + * Alert list + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of AlertListResult class. */ + public AlertListResult() { + } + + /** + * Get the value property: Alert list. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Alert list. + * + * @param value the value value to set. + * @return the AlertListResult object itself. + */ + public AlertListResult 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 AlertListResult object itself. + */ + public AlertListResult 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/AlertOperationResult.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertOperationResult.java new file mode 100644 index 000000000000..4d2120145bd9 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertOperationResult.java @@ -0,0 +1,60 @@ +// 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.AlertOperationResultInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of AlertOperationResult. */ +public interface AlertOperationResult { + /** + * Gets the id property: The id of the alert operation. + * + * @return the id value. + */ + String id(); + + /** + * Gets the status property: The status of the alert operation. + * + * @return the status value. + */ + String status(); + + /** + * Gets the statusDetail property: The status detail of the alert operation. + * + * @return the statusDetail value. + */ + String statusDetail(); + + /** + * Gets the createdDateTime property: The created date of the alert operation. + * + * @return the createdDateTime value. + */ + OffsetDateTime createdDateTime(); + + /** + * Gets the lastActionDateTime property: The last action date of the alert operation. + * + * @return the lastActionDateTime value. + */ + OffsetDateTime lastActionDateTime(); + + /** + * Gets the resourceLocation property: The location of the alert associated with the operation. + * + * @return the resourceLocation value. + */ + String resourceLocation(); + + /** + * Gets the inner com.azure.resourcemanager.authorization.generated.fluent.models.AlertOperationResultInner object. + * + * @return the inner object. + */ + AlertOperationResultInner innerModel(); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertOperations.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertOperations.java new file mode 100644 index 000000000000..02d92652c19d --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertOperations.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.Response; +import com.azure.core.util.Context; + +/** Resource collection API of AlertOperations. */ +public interface AlertOperations { + /** + * Get the specified alert operation. + * + * @param scope The scope of the alert operation. + * @param operationId The id of the alert operation. + * @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 specified alert operation along with {@link Response}. + */ + Response getWithResponse(String scope, String operationId, Context context); + + /** + * Get the specified alert operation. + * + * @param scope The scope of the alert operation. + * @param operationId The id of the alert 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 specified alert operation. + */ + AlertOperationResult get(String scope, String operationId); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertProperties.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertProperties.java new file mode 100644 index 000000000000..ac0b995202cc --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AlertProperties.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.models; + +import com.azure.resourcemanager.authorization.generated.fluent.models.AlertPropertiesInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of AlertProperties. */ +public interface AlertProperties { + /** + * Gets the scope property: The alert scope. + * + * @return the scope value. + */ + String scope(); + + /** + * Gets the isActive property: False by default; true if the alert is active. + * + * @return the isActive value. + */ + Boolean isActive(); + + /** + * Gets the incidentCount property: The number of generated incidents of the alert. + * + * @return the incidentCount value. + */ + Integer incidentCount(); + + /** + * Gets the lastModifiedDateTime property: The date time when the alert configuration was updated or new incidents + * were generated. + * + * @return the lastModifiedDateTime value. + */ + OffsetDateTime lastModifiedDateTime(); + + /** + * Gets the lastScannedDateTime property: The date time when the alert was last scanned. + * + * @return the lastScannedDateTime value. + */ + OffsetDateTime lastScannedDateTime(); + + /** + * Gets the alertDefinition property: The alert definition. + * + * @return the alertDefinition value. + */ + AlertDefinition alertDefinition(); + + /** + * Gets the alertIncidents property: The alert incidents. + * + * @return the alertIncidents value. + */ + List alertIncidents(); + + /** + * Gets the alertConfiguration property: The alert configuration. + * + * @return the alertConfiguration value. + */ + AlertConfiguration alertConfiguration(); + + /** + * Gets the inner com.azure.resourcemanager.authorization.generated.fluent.models.AlertPropertiesInner object. + * + * @return the inner object. + */ + AlertPropertiesInner innerModel(); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/Alerts.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/Alerts.java new file mode 100644 index 000000000000..a198bed8c0b8 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/Alerts.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.AlertInner; + +/** Resource collection API of Alerts. */ +public interface Alerts { + /** + * Get the specified alert. + * + * @param scope The scope of the alert. The scope can be any REST resource instance. For example, use + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param alertId The name of the alert to get. + * @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 specified alert along with {@link Response}. + */ + Response getWithResponse(String scope, String alertId, Context context); + + /** + * Get the specified alert. + * + * @param scope The scope of the alert. The scope can be any REST resource instance. For example, use + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for + * a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @param alertId The name of the alert to get. + * @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 specified alert. + */ + Alert get(String scope, String alertId); + + /** + * Update an alert. + * + * @param scope The scope of the alert. + * @param alertId The name of the alert to dismiss. + * @param parameters Parameters for the alert. + * @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 updateWithResponse(String scope, String alertId, AlertInner parameters, Context context); + + /** + * Update an alert. + * + * @param scope The scope of the alert. + * @param alertId The name of the alert to dismiss. + * @param parameters Parameters for the alert. + * @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 update(String scope, String alertId, AlertInner parameters); + + /** + * Gets alerts for a resource scope. + * + * @param scope The scope of the alert. + * @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 alerts for a resource scope as paginated response with {@link PagedIterable}. + */ + PagedIterable listForScope(String scope); + + /** + * Gets alerts for a resource scope. + * + * @param scope The scope of the alert. + * @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 alerts for a resource scope as paginated response with {@link PagedIterable}. + */ + PagedIterable listForScope(String scope, Context context); + + /** + * Refresh an alert. + * + * @param scope The scope of the alert. + * @param alertId The name of the alert to refresh. + * @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 alert operation result. + */ + AlertOperationResult refresh(String scope, String alertId); + + /** + * Refresh an alert. + * + * @param scope The scope of the alert. + * @param alertId The name of the alert to refresh. + * @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 alert operation result. + */ + AlertOperationResult refresh(String scope, String alertId, Context context); + + /** + * Refresh all alerts for a resource scope. + * + * @param scope The scope of the alert. + * @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 alert operation result. + */ + AlertOperationResult refreshAll(String scope); + + /** + * Refresh all alerts for a resource scope. + * + * @param scope The scope of the alert. + * @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 alert operation result. + */ + AlertOperationResult refreshAll(String scope, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ApprovalMode.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ApprovalMode.java new file mode 100644 index 000000000000..4565419114a8 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ApprovalMode.java @@ -0,0 +1,53 @@ +// 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 rule. */ +public final class ApprovalMode extends ExpandableStringEnum { + /** Static value SingleStage for ApprovalMode. */ + public static final ApprovalMode SINGLE_STAGE = fromString("SingleStage"); + + /** Static value Serial for ApprovalMode. */ + public static final ApprovalMode SERIAL = fromString("Serial"); + + /** Static value Parallel for ApprovalMode. */ + public static final ApprovalMode PARALLEL = fromString("Parallel"); + + /** Static value NoApproval for ApprovalMode. */ + public static final ApprovalMode NO_APPROVAL = fromString("NoApproval"); + + /** + * Creates a new instance of ApprovalMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ApprovalMode() { + } + + /** + * Creates or finds a ApprovalMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApprovalMode. + */ + @JsonCreator + public static ApprovalMode fromString(String name) { + return fromString(name, ApprovalMode.class); + } + + /** + * Gets known ApprovalMode values. + * + * @return known ApprovalMode values. + */ + public static Collection values() { + return values(ApprovalMode.class); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ApprovalSettings.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ApprovalSettings.java new file mode 100644 index 000000000000..018c24ea1191 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ApprovalSettings.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The approval settings. */ +@Fluent +public final class ApprovalSettings { + /* + * Determines whether approval is required or not. + */ + @JsonProperty(value = "isApprovalRequired") + private Boolean isApprovalRequired; + + /* + * Determines whether approval is required for assignment extension. + */ + @JsonProperty(value = "isApprovalRequiredForExtension") + private Boolean isApprovalRequiredForExtension; + + /* + * Determine whether requestor justification is required. + */ + @JsonProperty(value = "isRequestorJustificationRequired") + private Boolean isRequestorJustificationRequired; + + /* + * The type of rule + */ + @JsonProperty(value = "approvalMode") + private ApprovalMode approvalMode; + + /* + * The approval stages of the request. + */ + @JsonProperty(value = "approvalStages") + private List approvalStages; + + /** Creates an instance of ApprovalSettings class. */ + public ApprovalSettings() { + } + + /** + * Get the isApprovalRequired property: Determines whether approval is required or not. + * + * @return the isApprovalRequired value. + */ + public Boolean isApprovalRequired() { + return this.isApprovalRequired; + } + + /** + * Set the isApprovalRequired property: Determines whether approval is required or not. + * + * @param isApprovalRequired the isApprovalRequired value to set. + * @return the ApprovalSettings object itself. + */ + public ApprovalSettings withIsApprovalRequired(Boolean isApprovalRequired) { + this.isApprovalRequired = isApprovalRequired; + return this; + } + + /** + * Get the isApprovalRequiredForExtension property: Determines whether approval is required for assignment + * extension. + * + * @return the isApprovalRequiredForExtension value. + */ + public Boolean isApprovalRequiredForExtension() { + return this.isApprovalRequiredForExtension; + } + + /** + * Set the isApprovalRequiredForExtension property: Determines whether approval is required for assignment + * extension. + * + * @param isApprovalRequiredForExtension the isApprovalRequiredForExtension value to set. + * @return the ApprovalSettings object itself. + */ + public ApprovalSettings withIsApprovalRequiredForExtension(Boolean isApprovalRequiredForExtension) { + this.isApprovalRequiredForExtension = isApprovalRequiredForExtension; + return this; + } + + /** + * Get the isRequestorJustificationRequired property: Determine whether requestor justification is required. + * + * @return the isRequestorJustificationRequired value. + */ + public Boolean isRequestorJustificationRequired() { + return this.isRequestorJustificationRequired; + } + + /** + * Set the isRequestorJustificationRequired property: Determine whether requestor justification is required. + * + * @param isRequestorJustificationRequired the isRequestorJustificationRequired value to set. + * @return the ApprovalSettings object itself. + */ + public ApprovalSettings withIsRequestorJustificationRequired(Boolean isRequestorJustificationRequired) { + this.isRequestorJustificationRequired = isRequestorJustificationRequired; + return this; + } + + /** + * Get the approvalMode property: The type of rule. + * + * @return the approvalMode value. + */ + public ApprovalMode approvalMode() { + return this.approvalMode; + } + + /** + * Set the approvalMode property: The type of rule. + * + * @param approvalMode the approvalMode value to set. + * @return the ApprovalSettings object itself. + */ + public ApprovalSettings withApprovalMode(ApprovalMode approvalMode) { + this.approvalMode = approvalMode; + return this; + } + + /** + * Get the approvalStages property: The approval stages of the request. + * + * @return the approvalStages value. + */ + public List approvalStages() { + return this.approvalStages; + } + + /** + * Set the approvalStages property: The approval stages of the request. + * + * @param approvalStages the approvalStages value to set. + * @return the ApprovalSettings object itself. + */ + public ApprovalSettings withApprovalStages(List approvalStages) { + this.approvalStages = approvalStages; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (approvalStages() != null) { + approvalStages().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ApprovalStage.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ApprovalStage.java new file mode 100644 index 000000000000..a1ef06f5d346 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ApprovalStage.java @@ -0,0 +1,191 @@ +// 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; +import java.util.List; + +/** The approval stage. */ +@Fluent +public final class ApprovalStage { + /* + * The time in days when approval request would be timed out + */ + @JsonProperty(value = "approvalStageTimeOutInDays") + private Integer approvalStageTimeOutInDays; + + /* + * Determines whether approver need to provide justification for his decision. + */ + @JsonProperty(value = "isApproverJustificationRequired") + private Boolean isApproverJustificationRequired; + + /* + * The time in minutes when the approval request would be escalated if the primary approver does not approve + */ + @JsonProperty(value = "escalationTimeInMinutes") + private Integer escalationTimeInMinutes; + + /* + * The primary approver of the request. + */ + @JsonProperty(value = "primaryApprovers") + private List primaryApprovers; + + /* + * The value determine whether escalation feature is enabled. + */ + @JsonProperty(value = "isEscalationEnabled") + private Boolean isEscalationEnabled; + + /* + * The escalation approver of the request. + */ + @JsonProperty(value = "escalationApprovers") + private List escalationApprovers; + + /** Creates an instance of ApprovalStage class. */ + public ApprovalStage() { + } + + /** + * Get the approvalStageTimeOutInDays property: The time in days when approval request would be timed out. + * + * @return the approvalStageTimeOutInDays value. + */ + public Integer approvalStageTimeOutInDays() { + return this.approvalStageTimeOutInDays; + } + + /** + * Set the approvalStageTimeOutInDays property: The time in days when approval request would be timed out. + * + * @param approvalStageTimeOutInDays the approvalStageTimeOutInDays value to set. + * @return the ApprovalStage object itself. + */ + public ApprovalStage withApprovalStageTimeOutInDays(Integer approvalStageTimeOutInDays) { + this.approvalStageTimeOutInDays = approvalStageTimeOutInDays; + return this; + } + + /** + * Get the isApproverJustificationRequired property: Determines whether approver need to provide justification for + * his decision. + * + * @return the isApproverJustificationRequired value. + */ + public Boolean isApproverJustificationRequired() { + return this.isApproverJustificationRequired; + } + + /** + * Set the isApproverJustificationRequired property: Determines whether approver need to provide justification for + * his decision. + * + * @param isApproverJustificationRequired the isApproverJustificationRequired value to set. + * @return the ApprovalStage object itself. + */ + public ApprovalStage withIsApproverJustificationRequired(Boolean isApproverJustificationRequired) { + this.isApproverJustificationRequired = isApproverJustificationRequired; + return this; + } + + /** + * Get the escalationTimeInMinutes property: The time in minutes when the approval request would be escalated if the + * primary approver does not approve. + * + * @return the escalationTimeInMinutes value. + */ + public Integer escalationTimeInMinutes() { + return this.escalationTimeInMinutes; + } + + /** + * Set the escalationTimeInMinutes property: The time in minutes when the approval request would be escalated if the + * primary approver does not approve. + * + * @param escalationTimeInMinutes the escalationTimeInMinutes value to set. + * @return the ApprovalStage object itself. + */ + public ApprovalStage withEscalationTimeInMinutes(Integer escalationTimeInMinutes) { + this.escalationTimeInMinutes = escalationTimeInMinutes; + return this; + } + + /** + * Get the primaryApprovers property: The primary approver of the request. + * + * @return the primaryApprovers value. + */ + public List primaryApprovers() { + return this.primaryApprovers; + } + + /** + * Set the primaryApprovers property: The primary approver of the request. + * + * @param primaryApprovers the primaryApprovers value to set. + * @return the ApprovalStage object itself. + */ + public ApprovalStage withPrimaryApprovers(List primaryApprovers) { + this.primaryApprovers = primaryApprovers; + return this; + } + + /** + * Get the isEscalationEnabled property: The value determine whether escalation feature is enabled. + * + * @return the isEscalationEnabled value. + */ + public Boolean isEscalationEnabled() { + return this.isEscalationEnabled; + } + + /** + * Set the isEscalationEnabled property: The value determine whether escalation feature is enabled. + * + * @param isEscalationEnabled the isEscalationEnabled value to set. + * @return the ApprovalStage object itself. + */ + public ApprovalStage withIsEscalationEnabled(Boolean isEscalationEnabled) { + this.isEscalationEnabled = isEscalationEnabled; + return this; + } + + /** + * Get the escalationApprovers property: The escalation approver of the request. + * + * @return the escalationApprovers value. + */ + public List escalationApprovers() { + return this.escalationApprovers; + } + + /** + * Set the escalationApprovers property: The escalation approver of the request. + * + * @param escalationApprovers the escalationApprovers value to set. + * @return the ApprovalStage object itself. + */ + public ApprovalStage withEscalationApprovers(List escalationApprovers) { + this.escalationApprovers = escalationApprovers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (primaryApprovers() != null) { + primaryApprovers().forEach(e -> e.validate()); + } + if (escalationApprovers() != null) { + escalationApprovers().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AssignmentType.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AssignmentType.java new file mode 100644 index 000000000000..f5d9531ef94e --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AssignmentType.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; + +/** Assignment type of the role assignment schedule. */ +public final class AssignmentType extends ExpandableStringEnum { + /** Static value Activated for AssignmentType. */ + public static final AssignmentType ACTIVATED = fromString("Activated"); + + /** Static value Assigned for AssignmentType. */ + public static final AssignmentType ASSIGNED = fromString("Assigned"); + + /** + * Creates a new instance of AssignmentType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AssignmentType() { + } + + /** + * Creates or finds a AssignmentType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AssignmentType. + */ + @JsonCreator + public static AssignmentType fromString(String name) { + return fromString(name, AssignmentType.class); + } + + /** + * Gets known AssignmentType values. + * + * @return known AssignmentType values. + */ + public static Collection values() { + return values(AssignmentType.class); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AzureRolesAssignedOutsidePimAlertConfigurationProperties.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AzureRolesAssignedOutsidePimAlertConfigurationProperties.java new file mode 100644 index 000000000000..198248257efe --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AzureRolesAssignedOutsidePimAlertConfigurationProperties.java @@ -0,0 +1,37 @@ +// 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.AlertConfigurationPropertiesInner; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The Azure roles assigned outside PIM alert configuration properties. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "alertConfigurationType") +@JsonTypeName("AzureRolesAssignedOutsidePimAlertConfiguration") +@Fluent +public final class AzureRolesAssignedOutsidePimAlertConfigurationProperties extends AlertConfigurationPropertiesInner { + /** Creates an instance of AzureRolesAssignedOutsidePimAlertConfigurationProperties class. */ + public AzureRolesAssignedOutsidePimAlertConfigurationProperties() { + } + + /** {@inheritDoc} */ + @Override + public AzureRolesAssignedOutsidePimAlertConfigurationProperties withIsEnabled(Boolean isEnabled) { + super.withIsEnabled(isEnabled); + return this; + } + + /** + * 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/AzureRolesAssignedOutsidePimAlertIncidentProperties.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AzureRolesAssignedOutsidePimAlertIncidentProperties.java new file mode 100644 index 000000000000..ccb5e4f14e51 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/AzureRolesAssignedOutsidePimAlertIncidentProperties.java @@ -0,0 +1,181 @@ +// 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; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; + +/** Azure roles assigned outside PIM alert incident properties. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "alertIncidentType") +@JsonTypeName("AzureRolesAssignedOutsidePimAlertIncident") +@Immutable +public final class AzureRolesAssignedOutsidePimAlertIncidentProperties extends AlertIncidentProperties { + /* + * The assignee display name. + */ + @JsonProperty(value = "assigneeDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String assigneeDisplayName; + + /* + * The assignee user principal name. + */ + @JsonProperty(value = "assigneeUserPrincipalName", access = JsonProperty.Access.WRITE_ONLY) + private String assigneeUserPrincipalName; + + /* + * The assignee ID. + */ + @JsonProperty(value = "assigneeId", access = JsonProperty.Access.WRITE_ONLY) + private String assigneeId; + + /* + * The role display name. + */ + @JsonProperty(value = "roleDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String roleDisplayName; + + /* + * The role template ID. + */ + @JsonProperty(value = "roleTemplateId", access = JsonProperty.Access.WRITE_ONLY) + private String roleTemplateId; + + /* + * The role definition ID. + */ + @JsonProperty(value = "roleDefinitionId", access = JsonProperty.Access.WRITE_ONLY) + private String roleDefinitionId; + + /* + * The date the assignment was activated. + */ + @JsonProperty(value = "assignmentActivatedDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime assignmentActivatedDate; + + /* + * The requestor ID. + */ + @JsonProperty(value = "requestorId", access = JsonProperty.Access.WRITE_ONLY) + private String requestorId; + + /* + * The requestor display name. + */ + @JsonProperty(value = "requestorDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String requestorDisplayName; + + /* + * The requestor user principal name. + */ + @JsonProperty(value = "requestorUserPrincipalName", access = JsonProperty.Access.WRITE_ONLY) + private String requestorUserPrincipalName; + + /** Creates an instance of AzureRolesAssignedOutsidePimAlertIncidentProperties class. */ + public AzureRolesAssignedOutsidePimAlertIncidentProperties() { + } + + /** + * Get the assigneeDisplayName property: The assignee display name. + * + * @return the assigneeDisplayName value. + */ + public String assigneeDisplayName() { + return this.assigneeDisplayName; + } + + /** + * Get the assigneeUserPrincipalName property: The assignee user principal name. + * + * @return the assigneeUserPrincipalName value. + */ + public String assigneeUserPrincipalName() { + return this.assigneeUserPrincipalName; + } + + /** + * Get the assigneeId property: The assignee ID. + * + * @return the assigneeId value. + */ + public String assigneeId() { + return this.assigneeId; + } + + /** + * Get the roleDisplayName property: The role display name. + * + * @return the roleDisplayName value. + */ + public String roleDisplayName() { + return this.roleDisplayName; + } + + /** + * Get the roleTemplateId property: The role template ID. + * + * @return the roleTemplateId value. + */ + public String roleTemplateId() { + return this.roleTemplateId; + } + + /** + * Get the roleDefinitionId property: The role definition ID. + * + * @return the roleDefinitionId value. + */ + public String roleDefinitionId() { + return this.roleDefinitionId; + } + + /** + * Get the assignmentActivatedDate property: The date the assignment was activated. + * + * @return the assignmentActivatedDate value. + */ + public OffsetDateTime assignmentActivatedDate() { + return this.assignmentActivatedDate; + } + + /** + * Get the requestorId property: The requestor ID. + * + * @return the requestorId value. + */ + public String requestorId() { + return this.requestorId; + } + + /** + * Get the requestorDisplayName property: The requestor display name. + * + * @return the requestorDisplayName value. + */ + public String requestorDisplayName() { + return this.requestorDisplayName; + } + + /** + * Get the requestorUserPrincipalName property: The requestor user principal name. + * + * @return the requestorUserPrincipalName value. + */ + public String requestorUserPrincipalName() { + return this.requestorUserPrincipalName; + } + + /** + * 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/ClassicAdministrator.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ClassicAdministrator.java new file mode 100644 index 000000000000..2256d60d2caa --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ClassicAdministrator.java @@ -0,0 +1,52 @@ +// 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.ClassicAdministratorInner; + +/** An immutable client-side representation of ClassicAdministrator. */ +public interface ClassicAdministrator { + /** + * Gets the id property: The ID of the administrator. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the administrator. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the administrator. + * + * @return the type value. + */ + String type(); + + /** + * Gets the emailAddress property: The email address of the administrator. + * + * @return the emailAddress value. + */ + String emailAddress(); + + /** + * Gets the role property: The role of the administrator. + * + * @return the role value. + */ + String role(); + + /** + * Gets the inner com.azure.resourcemanager.authorization.generated.fluent.models.ClassicAdministratorInner object. + * + * @return the inner object. + */ + ClassicAdministratorInner innerModel(); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ClassicAdministratorListResult.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ClassicAdministratorListResult.java new file mode 100644 index 000000000000..95d022ba2fec --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ClassicAdministratorListResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.authorization.generated.fluent.models.ClassicAdministratorInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** ClassicAdministrator list result information. */ +@Fluent +public final class ClassicAdministratorListResult { + /* + * An array of administrators. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of ClassicAdministratorListResult class. */ + public ClassicAdministratorListResult() { + } + + /** + * Get the value property: An array of administrators. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of administrators. + * + * @param value the value value to set. + * @return the ClassicAdministratorListResult object itself. + */ + public ClassicAdministratorListResult 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 ClassicAdministratorListResult object itself. + */ + public ClassicAdministratorListResult 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/ClassicAdministrators.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ClassicAdministrators.java new file mode 100644 index 000000000000..856dc16c24cc --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ClassicAdministrators.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 ClassicAdministrators. */ +public interface ClassicAdministrators { + /** + * Gets service administrator, account administrator, and co-administrators 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 service administrator, account administrator, and co-administrators for the subscription as paginated + * response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Gets service administrator, account administrator, and co-administrators 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 service administrator, account administrator, and co-administrators for the subscription 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/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 000000000000..e3522e6b9007 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/DecisionResourceType.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.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 a new instance of DecisionResourceType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DecisionResourceType() { + } + + /** + * 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 000000000000..0521ab8c9b14 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/DecisionTargetType.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 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 a new instance of DecisionTargetType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DecisionTargetType() { + } + + /** + * 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 000000000000..a0d3178ebf74 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/DefaultDecisionType.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.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 a new instance of DefaultDecisionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DefaultDecisionType() { + } + + /** + * 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/DenyAssignment.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/DenyAssignment.java new file mode 100644 index 000000000000..d8f998f27c0a --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/DenyAssignment.java @@ -0,0 +1,142 @@ +// 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.DenyAssignmentInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of DenyAssignment. */ +public interface DenyAssignment { + /** + * Gets the id property: The deny assignment ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The deny assignment name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The deny assignment type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the denyAssignmentName property: The display name of the deny assignment. + * + * @return the denyAssignmentName value. + */ + String denyAssignmentName(); + + /** + * Gets the description property: The description of the deny assignment. + * + * @return the description value. + */ + String description(); + + /** + * Gets the permissions property: An array of permissions that are denied by the deny assignment. + * + * @return the permissions value. + */ + List permissions(); + + /** + * Gets the scope property: The deny assignment scope. + * + * @return the scope value. + */ + String scope(); + + /** + * Gets the doNotApplyToChildScopes property: Determines if the deny assignment applies to child scopes. Default + * value is false. + * + * @return the doNotApplyToChildScopes value. + */ + Boolean doNotApplyToChildScopes(); + + /** + * Gets the principals property: Array of principals to which the deny assignment applies. + * + * @return the principals value. + */ + List principals(); + + /** + * Gets the excludePrincipals property: Array of principals to which the deny assignment does not apply. + * + * @return the excludePrincipals value. + */ + List excludePrincipals(); + + /** + * Gets the isSystemProtected property: Specifies whether this deny assignment was created by Azure and cannot be + * edited or deleted. + * + * @return the isSystemProtected value. + */ + Boolean isSystemProtected(); + + /** + * Gets the condition property: The conditions on the deny assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @return the condition value. + */ + String condition(); + + /** + * Gets the conditionVersion property: Version of the condition. + * + * @return the conditionVersion value. + */ + String conditionVersion(); + + /** + * Gets the createdOn property: Time it was created. + * + * @return the createdOn value. + */ + OffsetDateTime createdOn(); + + /** + * Gets the updatedOn property: Time it was updated. + * + * @return the updatedOn value. + */ + OffsetDateTime updatedOn(); + + /** + * Gets the createdBy property: Id of the user who created the assignment. + * + * @return the createdBy value. + */ + String createdBy(); + + /** + * Gets the updatedBy property: Id of the user who updated the assignment. + * + * @return the updatedBy value. + */ + String updatedBy(); + + /** + * Gets the inner com.azure.resourcemanager.authorization.generated.fluent.models.DenyAssignmentInner object. + * + * @return the inner object. + */ + DenyAssignmentInner innerModel(); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/DenyAssignmentListResult.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/DenyAssignmentListResult.java new file mode 100644 index 000000000000..bdbbcf34d01e --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/DenyAssignmentListResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.authorization.generated.fluent.models.DenyAssignmentInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Deny assignment list operation result. */ +@Fluent +public final class DenyAssignmentListResult { + /* + * Deny assignment list. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of DenyAssignmentListResult class. */ + public DenyAssignmentListResult() { + } + + /** + * Get the value property: Deny assignment list. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Deny assignment list. + * + * @param value the value value to set. + * @return the DenyAssignmentListResult object itself. + */ + public DenyAssignmentListResult 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 DenyAssignmentListResult object itself. + */ + public DenyAssignmentListResult 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/DenyAssignmentPermission.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/DenyAssignmentPermission.java new file mode 100644 index 000000000000..be26c71a891a --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/DenyAssignmentPermission.java @@ -0,0 +1,183 @@ +// 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; +import java.util.List; + +/** Deny assignment permissions. */ +@Fluent +public final class DenyAssignmentPermission { + /* + * Actions to which the deny assignment does not grant access. + */ + @JsonProperty(value = "actions") + private List actions; + + /* + * Actions to exclude from that the deny assignment does not grant access. + */ + @JsonProperty(value = "notActions") + private List notActions; + + /* + * Data actions to which the deny assignment does not grant access. + */ + @JsonProperty(value = "dataActions") + private List dataActions; + + /* + * Data actions to exclude from that the deny assignment does not grant access. + */ + @JsonProperty(value = "notDataActions") + private List notDataActions; + + /* + * The conditions on the Deny assignment permission. This limits the resources it applies to. + */ + @JsonProperty(value = "condition") + private String condition; + + /* + * Version of the condition. + */ + @JsonProperty(value = "conditionVersion") + private String conditionVersion; + + /** Creates an instance of DenyAssignmentPermission class. */ + public DenyAssignmentPermission() { + } + + /** + * Get the actions property: Actions to which the deny assignment does not grant access. + * + * @return the actions value. + */ + public List actions() { + return this.actions; + } + + /** + * Set the actions property: Actions to which the deny assignment does not grant access. + * + * @param actions the actions value to set. + * @return the DenyAssignmentPermission object itself. + */ + public DenyAssignmentPermission withActions(List actions) { + this.actions = actions; + return this; + } + + /** + * Get the notActions property: Actions to exclude from that the deny assignment does not grant access. + * + * @return the notActions value. + */ + public List notActions() { + return this.notActions; + } + + /** + * Set the notActions property: Actions to exclude from that the deny assignment does not grant access. + * + * @param notActions the notActions value to set. + * @return the DenyAssignmentPermission object itself. + */ + public DenyAssignmentPermission withNotActions(List notActions) { + this.notActions = notActions; + return this; + } + + /** + * Get the dataActions property: Data actions to which the deny assignment does not grant access. + * + * @return the dataActions value. + */ + public List dataActions() { + return this.dataActions; + } + + /** + * Set the dataActions property: Data actions to which the deny assignment does not grant access. + * + * @param dataActions the dataActions value to set. + * @return the DenyAssignmentPermission object itself. + */ + public DenyAssignmentPermission withDataActions(List dataActions) { + this.dataActions = dataActions; + return this; + } + + /** + * Get the notDataActions property: Data actions to exclude from that the deny assignment does not grant access. + * + * @return the notDataActions value. + */ + public List notDataActions() { + return this.notDataActions; + } + + /** + * Set the notDataActions property: Data actions to exclude from that the deny assignment does not grant access. + * + * @param notDataActions the notDataActions value to set. + * @return the DenyAssignmentPermission object itself. + */ + public DenyAssignmentPermission withNotDataActions(List notDataActions) { + this.notDataActions = notDataActions; + return this; + } + + /** + * Get the condition property: The conditions on the Deny assignment permission. This limits the resources it + * applies to. + * + * @return the condition value. + */ + public String condition() { + return this.condition; + } + + /** + * Set the condition property: The conditions on the Deny assignment permission. This limits the resources it + * applies to. + * + * @param condition the condition value to set. + * @return the DenyAssignmentPermission object itself. + */ + public DenyAssignmentPermission withCondition(String condition) { + this.condition = condition; + return this; + } + + /** + * Get the conditionVersion property: Version of the condition. + * + * @return the conditionVersion value. + */ + public String conditionVersion() { + return this.conditionVersion; + } + + /** + * Set the conditionVersion property: Version of the condition. + * + * @param conditionVersion the conditionVersion value to set. + * @return the DenyAssignmentPermission object itself. + */ + public DenyAssignmentPermission withConditionVersion(String conditionVersion) { + this.conditionVersion = conditionVersion; + 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/DenyAssignments.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/DenyAssignments.java new file mode 100644 index 000000000000..326c3214fd1f --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/DenyAssignments.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.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 DenyAssignments. */ +public interface DenyAssignments { + /** + * Gets deny assignments for a resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get deny assignments 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 deny assignments for a resource as paginated response with {@link PagedIterable}. + */ + PagedIterable listForResource( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName); + + /** + * Gets deny assignments for a resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get deny assignments for. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or + * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified + * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the + * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and + * below the scope for the specified principal. This filter is different from the principalId filter as it + * returns not only those deny assignments that contain the specified principal is the Principals list but also + * those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when + * gdprExportPrincipalId filter is used, only the deny assignment name and description properties 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 deny assignments for a resource as paginated response with {@link PagedIterable}. + */ + PagedIterable listForResource( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String filter, + Context context); + + /** + * Gets deny assignments for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 deny assignments for a resource group as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets deny assignments for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or + * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified + * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the + * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and + * below the scope for the specified principal. This filter is different from the principalId filter as it + * returns not only those deny assignments that contain the specified principal is the Principals list but also + * those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when + * gdprExportPrincipalId filter is used, only the deny assignment name and description properties 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 deny assignments for a resource group as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, String filter, Context context); + + /** + * Gets all deny assignments 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 all deny assignments for the subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Gets all deny assignments for the subscription. + * + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or + * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified + * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the + * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and + * below the scope for the specified principal. This filter is different from the principalId filter as it + * returns not only those deny assignments that contain the specified principal is the Principals list but also + * those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when + * gdprExportPrincipalId filter is used, only the deny assignment name and description properties 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 all deny assignments for the subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String filter, Context context); + + /** + * Get the specified deny assignment. + * + * @param scope The scope of the deny assignment. + * @param denyAssignmentId The ID of the deny assignment to get. + * @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 specified deny assignment along with {@link Response}. + */ + Response getWithResponse(String scope, String denyAssignmentId, Context context); + + /** + * Get the specified deny assignment. + * + * @param scope The scope of the deny assignment. + * @param denyAssignmentId The ID of the deny assignment to get. + * @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 specified deny assignment. + */ + DenyAssignment get(String scope, String denyAssignmentId); + + /** + * Gets a deny assignment by ID. + * + * @param denyAssignmentId The fully qualified deny assignment ID. For example, use the format, + * /subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for subscription + * level deny assignments, or /providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for tenant + * level deny assignments. + * @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 a deny assignment by ID along with {@link Response}. + */ + Response getByIdWithResponse(String denyAssignmentId, Context context); + + /** + * Gets a deny assignment by ID. + * + * @param denyAssignmentId The fully qualified deny assignment ID. For example, use the format, + * /subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for subscription + * level deny assignments, or /providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for tenant + * level deny assignments. + * @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 a deny assignment by ID. + */ + DenyAssignment getById(String denyAssignmentId); + + /** + * Gets deny assignments for a scope. + * + * @param scope The scope of the deny assignments. + * @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 deny assignments for a scope as paginated response with {@link PagedIterable}. + */ + PagedIterable listForScope(String scope); + + /** + * Gets deny assignments for a scope. + * + * @param scope The scope of the deny assignments. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or + * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified + * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the + * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and + * below the scope for the specified principal. This filter is different from the principalId filter as it + * returns not only those deny assignments that contain the specified principal is the Principals list but also + * those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when + * gdprExportPrincipalId filter is used, only the deny assignment name and description properties 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 deny assignments for a scope as paginated response with {@link PagedIterable}. + */ + PagedIterable listForScope(String scope, String filter, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/DuplicateRoleCreatedAlertConfigurationProperties.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/DuplicateRoleCreatedAlertConfigurationProperties.java new file mode 100644 index 000000000000..e5968386fe7e --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/DuplicateRoleCreatedAlertConfigurationProperties.java @@ -0,0 +1,37 @@ +// 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.AlertConfigurationPropertiesInner; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The duplicate role created alert configuration. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "alertConfigurationType") +@JsonTypeName("DuplicateRoleCreatedAlertConfiguration") +@Fluent +public final class DuplicateRoleCreatedAlertConfigurationProperties extends AlertConfigurationPropertiesInner { + /** Creates an instance of DuplicateRoleCreatedAlertConfigurationProperties class. */ + public DuplicateRoleCreatedAlertConfigurationProperties() { + } + + /** {@inheritDoc} */ + @Override + public DuplicateRoleCreatedAlertConfigurationProperties withIsEnabled(Boolean isEnabled) { + super.withIsEnabled(isEnabled); + return this; + } + + /** + * 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/DuplicateRoleCreatedAlertIncidentProperties.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/DuplicateRoleCreatedAlertIncidentProperties.java new file mode 100644 index 000000000000..28a2c81ed8eb --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/DuplicateRoleCreatedAlertIncidentProperties.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.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Duplicate role created alert incident properties. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "alertIncidentType") +@JsonTypeName("DuplicateRoleCreatedAlertIncident") +@Immutable +public final class DuplicateRoleCreatedAlertIncidentProperties extends AlertIncidentProperties { + /* + * The role name. + */ + @JsonProperty(value = "roleName", access = JsonProperty.Access.WRITE_ONLY) + private String roleName; + + /* + * The duplicate roles. + */ + @JsonProperty(value = "duplicateRoles", access = JsonProperty.Access.WRITE_ONLY) + private String duplicateRoles; + + /* + * The reason for the incident. + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private String reason; + + /** Creates an instance of DuplicateRoleCreatedAlertIncidentProperties class. */ + public DuplicateRoleCreatedAlertIncidentProperties() { + } + + /** + * Get the roleName property: The role name. + * + * @return the roleName value. + */ + public String roleName() { + return this.roleName; + } + + /** + * Get the duplicateRoles property: The duplicate roles. + * + * @return the duplicateRoles value. + */ + public String duplicateRoles() { + return this.duplicateRoles; + } + + /** + * Get the reason property: The reason for the incident. + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * 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/EligibleChildResource.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/EligibleChildResource.java new file mode 100644 index 000000000000..d834b72f6177 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/EligibleChildResource.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.resourcemanager.authorization.generated.fluent.models.EligibleChildResourceInner; + +/** An immutable client-side representation of EligibleChildResource. */ +public interface EligibleChildResource { + /** + * Gets the id property: The resource scope Id. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The resource name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the inner com.azure.resourcemanager.authorization.generated.fluent.models.EligibleChildResourceInner object. + * + * @return the inner object. + */ + EligibleChildResourceInner innerModel(); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/EligibleChildResources.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/EligibleChildResources.java new file mode 100644 index 000000000000..a712b62faf86 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/EligibleChildResources.java @@ -0,0 +1,40 @@ +// 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 EligibleChildResources. */ +public interface EligibleChildResources { + /** + * Get the child resources of a resource on which user has eligible access. + * + * @param scope The scope of the role management policy. + * @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 child resources of a resource on which user has eligible access as paginated response with {@link + * PagedIterable}. + */ + PagedIterable get(String scope); + + /** + * Get the child resources of a resource on which user has eligible access. + * + * @param scope The scope of the role management policy. + * @param filter The filter to apply on the operation. Use $filter=resourceType+eq+'Subscription' to filter on only + * resource of type = 'Subscription'. Use + * $filter=resourceType+eq+'subscription'+or+resourceType+eq+'resourcegroup' to filter on resource of type = + * 'Subscription' or 'ResourceGroup'. + * @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 child resources of a resource on which user has eligible access as paginated response with {@link + * PagedIterable}. + */ + PagedIterable get(String scope, String filter, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/EligibleChildResourcesListResult.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/EligibleChildResourcesListResult.java new file mode 100644 index 000000000000..b3cdd68d31ef --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/EligibleChildResourcesListResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.authorization.generated.fluent.models.EligibleChildResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Eligible child resources list operation result. */ +@Fluent +public final class EligibleChildResourcesListResult { + /* + * Eligible child resource list. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of EligibleChildResourcesListResult class. */ + public EligibleChildResourcesListResult() { + } + + /** + * Get the value property: Eligible child resource list. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Eligible child resource list. + * + * @param value the value value to set. + * @return the EligibleChildResourcesListResult object itself. + */ + public EligibleChildResourcesListResult 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 EligibleChildResourcesListResult object itself. + */ + public EligibleChildResourcesListResult 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/EnablementRules.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/EnablementRules.java new file mode 100644 index 000000000000..fdf617b5e745 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/EnablementRules.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of enablement rule. */ +public final class EnablementRules extends ExpandableStringEnum { + /** Static value MultiFactorAuthentication for EnablementRules. */ + public static final EnablementRules MULTI_FACTOR_AUTHENTICATION = fromString("MultiFactorAuthentication"); + + /** Static value Justification for EnablementRules. */ + public static final EnablementRules JUSTIFICATION = fromString("Justification"); + + /** Static value Ticketing for EnablementRules. */ + public static final EnablementRules TICKETING = fromString("Ticketing"); + + /** + * Creates a new instance of EnablementRules value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EnablementRules() { + } + + /** + * Creates or finds a EnablementRules from its string representation. + * + * @param name a name to look for. + * @return the corresponding EnablementRules. + */ + @JsonCreator + public static EnablementRules fromString(String name) { + return fromString(name, EnablementRules.class); + } + + /** + * Gets known EnablementRules values. + * + * @return known EnablementRules values. + */ + public static Collection values() { + return values(EnablementRules.class); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ExpandedProperties.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ExpandedProperties.java new file mode 100644 index 000000000000..6e860f27547f --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ExpandedProperties.java @@ -0,0 +1,111 @@ +// 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; + +/** The ExpandedProperties model. */ +@Fluent +public final class ExpandedProperties { + /* + * Details of the resource scope + */ + @JsonProperty(value = "scope") + private ExpandedPropertiesScope scope; + + /* + * Details of role definition + */ + @JsonProperty(value = "roleDefinition") + private ExpandedPropertiesRoleDefinition roleDefinition; + + /* + * Details of the principal + */ + @JsonProperty(value = "principal") + private ExpandedPropertiesPrincipal principal; + + /** Creates an instance of ExpandedProperties class. */ + public ExpandedProperties() { + } + + /** + * Get the scope property: Details of the resource scope. + * + * @return the scope value. + */ + public ExpandedPropertiesScope scope() { + return this.scope; + } + + /** + * Set the scope property: Details of the resource scope. + * + * @param scope the scope value to set. + * @return the ExpandedProperties object itself. + */ + public ExpandedProperties withScope(ExpandedPropertiesScope scope) { + this.scope = scope; + return this; + } + + /** + * Get the roleDefinition property: Details of role definition. + * + * @return the roleDefinition value. + */ + public ExpandedPropertiesRoleDefinition roleDefinition() { + return this.roleDefinition; + } + + /** + * Set the roleDefinition property: Details of role definition. + * + * @param roleDefinition the roleDefinition value to set. + * @return the ExpandedProperties object itself. + */ + public ExpandedProperties withRoleDefinition(ExpandedPropertiesRoleDefinition roleDefinition) { + this.roleDefinition = roleDefinition; + return this; + } + + /** + * Get the principal property: Details of the principal. + * + * @return the principal value. + */ + public ExpandedPropertiesPrincipal principal() { + return this.principal; + } + + /** + * Set the principal property: Details of the principal. + * + * @param principal the principal value to set. + * @return the ExpandedProperties object itself. + */ + public ExpandedProperties withPrincipal(ExpandedPropertiesPrincipal principal) { + this.principal = principal; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (scope() != null) { + scope().validate(); + } + if (roleDefinition() != null) { + roleDefinition().validate(); + } + if (principal() != null) { + principal().validate(); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ExpandedPropertiesPrincipal.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ExpandedPropertiesPrincipal.java new file mode 100644 index 000000000000..85045ee08f7f --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ExpandedPropertiesPrincipal.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Details of the principal. */ +@Fluent +public final class ExpandedPropertiesPrincipal { + /* + * Id of the principal + */ + @JsonProperty(value = "id") + private String id; + + /* + * Display name of the principal + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Email id of the principal + */ + @JsonProperty(value = "email") + private String email; + + /* + * Type of the principal + */ + @JsonProperty(value = "type") + private String type; + + /** Creates an instance of ExpandedPropertiesPrincipal class. */ + public ExpandedPropertiesPrincipal() { + } + + /** + * Get the id property: Id of the principal. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Id of the principal. + * + * @param id the id value to set. + * @return the ExpandedPropertiesPrincipal object itself. + */ + public ExpandedPropertiesPrincipal withId(String id) { + this.id = id; + return this; + } + + /** + * Get the displayName property: Display name of the principal. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of the principal. + * + * @param displayName the displayName value to set. + * @return the ExpandedPropertiesPrincipal object itself. + */ + public ExpandedPropertiesPrincipal withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the email property: Email id of the principal. + * + * @return the email value. + */ + public String email() { + return this.email; + } + + /** + * Set the email property: Email id of the principal. + * + * @param email the email value to set. + * @return the ExpandedPropertiesPrincipal object itself. + */ + public ExpandedPropertiesPrincipal withEmail(String email) { + this.email = email; + return this; + } + + /** + * Get the type property: Type of the principal. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Type of the principal. + * + * @param type the type value to set. + * @return the ExpandedPropertiesPrincipal object itself. + */ + public ExpandedPropertiesPrincipal withType(String type) { + this.type = type; + 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/ExpandedPropertiesRoleDefinition.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ExpandedPropertiesRoleDefinition.java new file mode 100644 index 000000000000..0b0d1fa0950b --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ExpandedPropertiesRoleDefinition.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; + +/** Details of role definition. */ +@Fluent +public final class ExpandedPropertiesRoleDefinition { + /* + * Id of the role definition + */ + @JsonProperty(value = "id") + private String id; + + /* + * Display name of the role definition + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Type of the role definition + */ + @JsonProperty(value = "type") + private String type; + + /** Creates an instance of ExpandedPropertiesRoleDefinition class. */ + public ExpandedPropertiesRoleDefinition() { + } + + /** + * Get the id property: Id of the role definition. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Id of the role definition. + * + * @param id the id value to set. + * @return the ExpandedPropertiesRoleDefinition object itself. + */ + public ExpandedPropertiesRoleDefinition withId(String id) { + this.id = id; + return this; + } + + /** + * Get the displayName property: Display name of the role definition. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of the role definition. + * + * @param displayName the displayName value to set. + * @return the ExpandedPropertiesRoleDefinition object itself. + */ + public ExpandedPropertiesRoleDefinition withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the type property: Type of the role definition. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Type of the role definition. + * + * @param type the type value to set. + * @return the ExpandedPropertiesRoleDefinition object itself. + */ + public ExpandedPropertiesRoleDefinition withType(String type) { + this.type = type; + 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/ExpandedPropertiesScope.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ExpandedPropertiesScope.java new file mode 100644 index 000000000000..51dfecd063cd --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ExpandedPropertiesScope.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; + +/** Details of the resource scope. */ +@Fluent +public final class ExpandedPropertiesScope { + /* + * Scope id of the resource + */ + @JsonProperty(value = "id") + private String id; + + /* + * Display name of the resource + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Type of the resource + */ + @JsonProperty(value = "type") + private String type; + + /** Creates an instance of ExpandedPropertiesScope class. */ + public ExpandedPropertiesScope() { + } + + /** + * Get the id property: Scope id of the resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Scope id of the resource. + * + * @param id the id value to set. + * @return the ExpandedPropertiesScope object itself. + */ + public ExpandedPropertiesScope withId(String id) { + this.id = id; + return this; + } + + /** + * Get the displayName property: Display name of the resource. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of the resource. + * + * @param displayName the displayName value to set. + * @return the ExpandedPropertiesScope object itself. + */ + public ExpandedPropertiesScope withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the type property: Type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Type of the resource. + * + * @param type the type value to set. + * @return the ExpandedPropertiesScope object itself. + */ + public ExpandedPropertiesScope withType(String type) { + this.type = type; + 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/GlobalAdministrators.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/GlobalAdministrators.java new file mode 100644 index 000000000000..c4b474f244db --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/GlobalAdministrators.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.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of GlobalAdministrators. */ +public interface GlobalAdministrators { + /** + * Elevates access for a Global Administrator. + * + * @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 elevateAccessWithResponse(Context context); + + /** + * Elevates access for a Global Administrator. + * + * @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 elevateAccess(); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/MemberType.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/MemberType.java new file mode 100644 index 000000000000..2842f5c90cb1 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/MemberType.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Membership type of the role assignment schedule. */ +public final class MemberType extends ExpandableStringEnum { + /** Static value Inherited for MemberType. */ + public static final MemberType INHERITED = fromString("Inherited"); + + /** Static value Direct for MemberType. */ + public static final MemberType DIRECT = fromString("Direct"); + + /** Static value Group for MemberType. */ + public static final MemberType GROUP = fromString("Group"); + + /** + * Creates a new instance of MemberType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MemberType() { + } + + /** + * Creates or finds a MemberType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MemberType. + */ + @JsonCreator + public static MemberType fromString(String name) { + return fromString(name, MemberType.class); + } + + /** + * Gets known MemberType values. + * + * @return known MemberType values. + */ + public static Collection values() { + return values(MemberType.class); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/NotificationDeliveryMechanism.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/NotificationDeliveryMechanism.java new file mode 100644 index 000000000000..6418715ed3ca --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/NotificationDeliveryMechanism.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of notification. */ +public final class NotificationDeliveryMechanism extends ExpandableStringEnum { + /** Static value Email for NotificationDeliveryMechanism. */ + public static final NotificationDeliveryMechanism EMAIL = fromString("Email"); + + /** + * Creates a new instance of NotificationDeliveryMechanism value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NotificationDeliveryMechanism() { + } + + /** + * Creates or finds a NotificationDeliveryMechanism from its string representation. + * + * @param name a name to look for. + * @return the corresponding NotificationDeliveryMechanism. + */ + @JsonCreator + public static NotificationDeliveryMechanism fromString(String name) { + return fromString(name, NotificationDeliveryMechanism.class); + } + + /** + * Gets known NotificationDeliveryMechanism values. + * + * @return known NotificationDeliveryMechanism values. + */ + public static Collection values() { + return values(NotificationDeliveryMechanism.class); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/NotificationLevel.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/NotificationLevel.java new file mode 100644 index 000000000000..3b30f079b09e --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/NotificationLevel.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The notification level. */ +public final class NotificationLevel extends ExpandableStringEnum { + /** Static value None for NotificationLevel. */ + public static final NotificationLevel NONE = fromString("None"); + + /** Static value Critical for NotificationLevel. */ + public static final NotificationLevel CRITICAL = fromString("Critical"); + + /** Static value All for NotificationLevel. */ + public static final NotificationLevel ALL = fromString("All"); + + /** + * Creates a new instance of NotificationLevel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NotificationLevel() { + } + + /** + * Creates or finds a NotificationLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding NotificationLevel. + */ + @JsonCreator + public static NotificationLevel fromString(String name) { + return fromString(name, NotificationLevel.class); + } + + /** + * Gets known NotificationLevel values. + * + * @return known NotificationLevel values. + */ + public static Collection values() { + return values(NotificationLevel.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 000000000000..a5eaf0409aa1 --- /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 000000000000..12fe9550b556 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/OperationDisplay.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.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; + + /** Creates an instance of OperationDisplay class. */ + public OperationDisplay() { + } + + /** + * 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 000000000000..4e845708d323 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/OperationListResult.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.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; + + /** Creates an instance of OperationListResult class. */ + public OperationListResult() { + } + + /** + * 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 000000000000..bdcff7eab698 --- /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/Permission.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/Permission.java new file mode 100644 index 000000000000..18f73d17d9b7 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/Permission.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.models; + +import com.azure.resourcemanager.authorization.generated.fluent.models.PermissionInner; +import java.util.List; + +/** An immutable client-side representation of Permission. */ +public interface Permission { + /** + * Gets the actions property: Allowed actions. + * + * @return the actions value. + */ + List actions(); + + /** + * Gets the notActions property: Denied actions. + * + * @return the notActions value. + */ + List notActions(); + + /** + * Gets the dataActions property: Allowed Data actions. + * + * @return the dataActions value. + */ + List dataActions(); + + /** + * Gets the notDataActions property: Denied Data actions. + * + * @return the notDataActions value. + */ + List notDataActions(); + + /** + * Gets the condition property: The conditions on the role definition. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @return the condition value. + */ + String condition(); + + /** + * Gets the conditionVersion property: Version of the condition. Currently the only accepted value is '2.0'. + * + * @return the conditionVersion value. + */ + String conditionVersion(); + + /** + * Gets the inner com.azure.resourcemanager.authorization.generated.fluent.models.PermissionInner object. + * + * @return the inner object. + */ + PermissionInner innerModel(); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/PermissionGetResult.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/PermissionGetResult.java new file mode 100644 index 000000000000..486701fca1ee --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/PermissionGetResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.authorization.generated.fluent.models.PermissionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Permissions information. */ +@Fluent +public final class PermissionGetResult { + /* + * An array of permissions. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of PermissionGetResult class. */ + public PermissionGetResult() { + } + + /** + * Get the value property: An array of permissions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of permissions. + * + * @param value the value value to set. + * @return the PermissionGetResult object itself. + */ + public PermissionGetResult 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 PermissionGetResult object itself. + */ + public PermissionGetResult 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/Permissions.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/Permissions.java new file mode 100644 index 000000000000..77e7919dd478 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/Permissions.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.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Permissions. */ +public interface Permissions { + /** + * Gets all permissions the caller has for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 all permissions the caller has for a resource group as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all permissions the caller has for a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 all permissions the caller has for a resource group as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all permissions the caller has for a resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get the permissions 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 all permissions the caller has for a resource as paginated response with {@link PagedIterable}. + */ + PagedIterable listForResource( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName); + + /** + * Gets all permissions the caller has for a resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get the permissions 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 all permissions the caller has for a resource as paginated response with {@link PagedIterable}. + */ + PagedIterable listForResource( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/PolicyAssignmentProperties.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/PolicyAssignmentProperties.java new file mode 100644 index 000000000000..e2930b075792 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/PolicyAssignmentProperties.java @@ -0,0 +1,111 @@ +// 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; + +/** The PolicyAssignmentProperties model. */ +@Fluent +public final class PolicyAssignmentProperties { + /* + * Details of the resource scope + */ + @JsonProperty(value = "scope") + private PolicyAssignmentPropertiesScope scope; + + /* + * Details of role definition + */ + @JsonProperty(value = "roleDefinition") + private PolicyAssignmentPropertiesRoleDefinition roleDefinition; + + /* + * Details of the policy + */ + @JsonProperty(value = "policy") + private PolicyAssignmentPropertiesPolicy policy; + + /** Creates an instance of PolicyAssignmentProperties class. */ + public PolicyAssignmentProperties() { + } + + /** + * Get the scope property: Details of the resource scope. + * + * @return the scope value. + */ + public PolicyAssignmentPropertiesScope scope() { + return this.scope; + } + + /** + * Set the scope property: Details of the resource scope. + * + * @param scope the scope value to set. + * @return the PolicyAssignmentProperties object itself. + */ + public PolicyAssignmentProperties withScope(PolicyAssignmentPropertiesScope scope) { + this.scope = scope; + return this; + } + + /** + * Get the roleDefinition property: Details of role definition. + * + * @return the roleDefinition value. + */ + public PolicyAssignmentPropertiesRoleDefinition roleDefinition() { + return this.roleDefinition; + } + + /** + * Set the roleDefinition property: Details of role definition. + * + * @param roleDefinition the roleDefinition value to set. + * @return the PolicyAssignmentProperties object itself. + */ + public PolicyAssignmentProperties withRoleDefinition(PolicyAssignmentPropertiesRoleDefinition roleDefinition) { + this.roleDefinition = roleDefinition; + return this; + } + + /** + * Get the policy property: Details of the policy. + * + * @return the policy value. + */ + public PolicyAssignmentPropertiesPolicy policy() { + return this.policy; + } + + /** + * Set the policy property: Details of the policy. + * + * @param policy the policy value to set. + * @return the PolicyAssignmentProperties object itself. + */ + public PolicyAssignmentProperties withPolicy(PolicyAssignmentPropertiesPolicy policy) { + this.policy = policy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (scope() != null) { + scope().validate(); + } + if (roleDefinition() != null) { + roleDefinition().validate(); + } + if (policy() != null) { + policy().validate(); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/PolicyAssignmentPropertiesPolicy.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/PolicyAssignmentPropertiesPolicy.java new file mode 100644 index 000000000000..9c575566c6a7 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/PolicyAssignmentPropertiesPolicy.java @@ -0,0 +1,95 @@ +// 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; +import java.time.OffsetDateTime; + +/** Details of the policy. */ +@Fluent +public final class PolicyAssignmentPropertiesPolicy { + /* + * Id of the policy + */ + @JsonProperty(value = "id") + private String id; + + /* + * The name of the entity last modified it + */ + @JsonProperty(value = "lastModifiedBy", access = JsonProperty.Access.WRITE_ONLY) + private Principal lastModifiedBy; + + /* + * The last modified date time. + */ + @JsonProperty(value = "lastModifiedDateTime") + private OffsetDateTime lastModifiedDateTime; + + /** Creates an instance of PolicyAssignmentPropertiesPolicy class. */ + public PolicyAssignmentPropertiesPolicy() { + } + + /** + * Get the id property: Id of the policy. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Id of the policy. + * + * @param id the id value to set. + * @return the PolicyAssignmentPropertiesPolicy object itself. + */ + public PolicyAssignmentPropertiesPolicy withId(String id) { + this.id = id; + return this; + } + + /** + * Get the lastModifiedBy property: The name of the entity last modified it. + * + * @return the lastModifiedBy value. + */ + public Principal lastModifiedBy() { + return this.lastModifiedBy; + } + + /** + * Get the lastModifiedDateTime property: The last modified date time. + * + * @return the lastModifiedDateTime value. + */ + public OffsetDateTime lastModifiedDateTime() { + return this.lastModifiedDateTime; + } + + /** + * Set the lastModifiedDateTime property: The last modified date time. + * + * @param lastModifiedDateTime the lastModifiedDateTime value to set. + * @return the PolicyAssignmentPropertiesPolicy object itself. + */ + public PolicyAssignmentPropertiesPolicy withLastModifiedDateTime(OffsetDateTime lastModifiedDateTime) { + this.lastModifiedDateTime = lastModifiedDateTime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (lastModifiedBy() != null) { + lastModifiedBy().validate(); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/PolicyAssignmentPropertiesRoleDefinition.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/PolicyAssignmentPropertiesRoleDefinition.java new file mode 100644 index 000000000000..6d1f2b06b1cf --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/PolicyAssignmentPropertiesRoleDefinition.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; + +/** Details of role definition. */ +@Fluent +public final class PolicyAssignmentPropertiesRoleDefinition { + /* + * Id of the role definition + */ + @JsonProperty(value = "id") + private String id; + + /* + * Display name of the role definition + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Type of the role definition + */ + @JsonProperty(value = "type") + private String type; + + /** Creates an instance of PolicyAssignmentPropertiesRoleDefinition class. */ + public PolicyAssignmentPropertiesRoleDefinition() { + } + + /** + * Get the id property: Id of the role definition. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Id of the role definition. + * + * @param id the id value to set. + * @return the PolicyAssignmentPropertiesRoleDefinition object itself. + */ + public PolicyAssignmentPropertiesRoleDefinition withId(String id) { + this.id = id; + return this; + } + + /** + * Get the displayName property: Display name of the role definition. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of the role definition. + * + * @param displayName the displayName value to set. + * @return the PolicyAssignmentPropertiesRoleDefinition object itself. + */ + public PolicyAssignmentPropertiesRoleDefinition withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the type property: Type of the role definition. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Type of the role definition. + * + * @param type the type value to set. + * @return the PolicyAssignmentPropertiesRoleDefinition object itself. + */ + public PolicyAssignmentPropertiesRoleDefinition withType(String type) { + this.type = type; + 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/PolicyAssignmentPropertiesScope.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/PolicyAssignmentPropertiesScope.java new file mode 100644 index 000000000000..1398f55419a2 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/PolicyAssignmentPropertiesScope.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; + +/** Details of the resource scope. */ +@Fluent +public final class PolicyAssignmentPropertiesScope { + /* + * Scope id of the resource + */ + @JsonProperty(value = "id") + private String id; + + /* + * Display name of the resource + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Type of the resource + */ + @JsonProperty(value = "type") + private String type; + + /** Creates an instance of PolicyAssignmentPropertiesScope class. */ + public PolicyAssignmentPropertiesScope() { + } + + /** + * Get the id property: Scope id of the resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Scope id of the resource. + * + * @param id the id value to set. + * @return the PolicyAssignmentPropertiesScope object itself. + */ + public PolicyAssignmentPropertiesScope withId(String id) { + this.id = id; + return this; + } + + /** + * Get the displayName property: Display name of the resource. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of the resource. + * + * @param displayName the displayName value to set. + * @return the PolicyAssignmentPropertiesScope object itself. + */ + public PolicyAssignmentPropertiesScope withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the type property: Type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Type of the resource. + * + * @param type the type value to set. + * @return the PolicyAssignmentPropertiesScope object itself. + */ + public PolicyAssignmentPropertiesScope withType(String type) { + this.type = type; + 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/PolicyProperties.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/PolicyProperties.java new file mode 100644 index 000000000000..4ec704f5c67a --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/PolicyProperties.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.fasterxml.jackson.annotation.JsonProperty; + +/** The PolicyProperties model. */ +@Immutable +public final class PolicyProperties { + /* + * Details of the resource scope + */ + @JsonProperty(value = "scope", access = JsonProperty.Access.WRITE_ONLY) + private PolicyPropertiesScope scope; + + /** Creates an instance of PolicyProperties class. */ + public PolicyProperties() { + } + + /** + * Get the scope property: Details of the resource scope. + * + * @return the scope value. + */ + public PolicyPropertiesScope scope() { + return this.scope; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (scope() != null) { + scope().validate(); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/PolicyPropertiesScope.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/PolicyPropertiesScope.java new file mode 100644 index 000000000000..cc3980b17874 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/PolicyPropertiesScope.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; + +/** Details of the resource scope. */ +@Fluent +public final class PolicyPropertiesScope { + /* + * Scope id of the resource + */ + @JsonProperty(value = "id") + private String id; + + /* + * Display name of the resource + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Type of the resource + */ + @JsonProperty(value = "type") + private String type; + + /** Creates an instance of PolicyPropertiesScope class. */ + public PolicyPropertiesScope() { + } + + /** + * Get the id property: Scope id of the resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Scope id of the resource. + * + * @param id the id value to set. + * @return the PolicyPropertiesScope object itself. + */ + public PolicyPropertiesScope withId(String id) { + this.id = id; + return this; + } + + /** + * Get the displayName property: Display name of the resource. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of the resource. + * + * @param displayName the displayName value to set. + * @return the PolicyPropertiesScope object itself. + */ + public PolicyPropertiesScope withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the type property: Type of the resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Type of the resource. + * + * @param type the type value to set. + * @return the PolicyPropertiesScope object itself. + */ + public PolicyPropertiesScope withType(String type) { + this.type = type; + 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/Principal.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/Principal.java new file mode 100644 index 000000000000..1ab06cc542f4 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/Principal.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The name of the entity last modified it. */ +@Fluent +public final class Principal { + /* + * The id of the principal made changes + */ + @JsonProperty(value = "id") + private String id; + + /* + * The name of the principal made changes + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Type of principal such as user , group etc + */ + @JsonProperty(value = "type") + private String type; + + /* + * Email of principal + */ + @JsonProperty(value = "email") + private String email; + + /** Creates an instance of Principal class. */ + public Principal() { + } + + /** + * Get the id property: The id of the principal made changes. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The id of the principal made changes. + * + * @param id the id value to set. + * @return the Principal object itself. + */ + public Principal withId(String id) { + this.id = id; + return this; + } + + /** + * Get the displayName property: The name of the principal made changes. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The name of the principal made changes. + * + * @param displayName the displayName value to set. + * @return the Principal object itself. + */ + public Principal withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the type property: Type of principal such as user , group etc. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Type of principal such as user , group etc. + * + * @param type the type value to set. + * @return the Principal object itself. + */ + public Principal withType(String type) { + this.type = type; + return this; + } + + /** + * Get the email property: Email of principal. + * + * @return the email value. + */ + public String email() { + return this.email; + } + + /** + * Set the email property: Email of principal. + * + * @param email the email value to set. + * @return the Principal object itself. + */ + public Principal withEmail(String email) { + this.email = email; + 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/PrincipalType.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/PrincipalType.java new file mode 100644 index 000000000000..048fb9ce526b --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/PrincipalType.java @@ -0,0 +1,56 @@ +// 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 principal type of the assigned principal ID. */ +public final class PrincipalType extends ExpandableStringEnum { + /** Static value User for PrincipalType. */ + public static final PrincipalType USER = fromString("User"); + + /** Static value Group for PrincipalType. */ + public static final PrincipalType GROUP = fromString("Group"); + + /** Static value ServicePrincipal for PrincipalType. */ + public static final PrincipalType SERVICE_PRINCIPAL = fromString("ServicePrincipal"); + + /** Static value ForeignGroup for PrincipalType. */ + public static final PrincipalType FOREIGN_GROUP = fromString("ForeignGroup"); + + /** Static value Device for PrincipalType. */ + public static final PrincipalType DEVICE = fromString("Device"); + + /** + * Creates a new instance of PrincipalType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PrincipalType() { + } + + /** + * Creates or finds a PrincipalType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrincipalType. + */ + @JsonCreator + public static PrincipalType fromString(String name) { + return fromString(name, PrincipalType.class); + } + + /** + * Gets known PrincipalType values. + * + * @return known PrincipalType values. + */ + public static Collection values() { + return values(PrincipalType.class); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ProviderOperation.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ProviderOperation.java new file mode 100644 index 000000000000..4e25627c63d1 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ProviderOperation.java @@ -0,0 +1,180 @@ +// 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; + +/** Operation. */ +@Fluent +public final class ProviderOperation { + /* + * The operation name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The operation display name. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * The operation description. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The operation origin. + */ + @JsonProperty(value = "origin") + private String origin; + + /* + * The operation properties. + */ + @JsonProperty(value = "properties") + private Object properties; + + /* + * The dataAction flag to specify the operation type. + */ + @JsonProperty(value = "isDataAction") + private Boolean isDataAction; + + /** Creates an instance of ProviderOperation class. */ + public ProviderOperation() { + } + + /** + * Get the name property: The operation name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The operation name. + * + * @param name the name value to set. + * @return the ProviderOperation object itself. + */ + public ProviderOperation withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: The operation display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The operation display name. + * + * @param displayName the displayName value to set. + * @return the ProviderOperation object itself. + */ + public ProviderOperation withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the description property: The operation description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The operation description. + * + * @param description the description value to set. + * @return the ProviderOperation object itself. + */ + public ProviderOperation withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the origin property: The operation origin. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin property: The operation origin. + * + * @param origin the origin value to set. + * @return the ProviderOperation object itself. + */ + public ProviderOperation withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get the properties property: The operation properties. + * + * @return the properties value. + */ + public Object properties() { + return this.properties; + } + + /** + * Set the properties property: The operation properties. + * + * @param properties the properties value to set. + * @return the ProviderOperation object itself. + */ + public ProviderOperation withProperties(Object properties) { + this.properties = properties; + return this; + } + + /** + * Get the isDataAction property: The dataAction flag to specify the operation type. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set the isDataAction property: The dataAction flag to specify the operation type. + * + * @param isDataAction the isDataAction value to set. + * @return the ProviderOperation object itself. + */ + public ProviderOperation withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; + 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/ProviderOperationsMetadata.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ProviderOperationsMetadata.java new file mode 100644 index 000000000000..5807ed9d76f9 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ProviderOperationsMetadata.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.ProviderOperationsMetadataInner; +import java.util.List; + +/** An immutable client-side representation of ProviderOperationsMetadata. */ +public interface ProviderOperationsMetadata { + /** + * Gets the id property: The provider id. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The provider name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The provider type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the displayName property: The provider display name. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the resourceTypes property: The provider resource types. + * + * @return the resourceTypes value. + */ + List resourceTypes(); + + /** + * Gets the operations property: The provider operations. + * + * @return the operations value. + */ + List operations(); + + /** + * Gets the inner com.azure.resourcemanager.authorization.generated.fluent.models.ProviderOperationsMetadataInner + * object. + * + * @return the inner object. + */ + ProviderOperationsMetadataInner innerModel(); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ProviderOperationsMetadataListResult.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ProviderOperationsMetadataListResult.java new file mode 100644 index 000000000000..c8be61d8d071 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ProviderOperationsMetadataListResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.authorization.generated.fluent.models.ProviderOperationsMetadataInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Provider operations metadata list. */ +@Fluent +public final class ProviderOperationsMetadataListResult { + /* + * The list of providers. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of ProviderOperationsMetadataListResult class. */ + public ProviderOperationsMetadataListResult() { + } + + /** + * Get the value property: The list of providers. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of providers. + * + * @param value the value value to set. + * @return the ProviderOperationsMetadataListResult object itself. + */ + public ProviderOperationsMetadataListResult 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 ProviderOperationsMetadataListResult object itself. + */ + public ProviderOperationsMetadataListResult 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/ProviderOperationsMetadatas.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ProviderOperationsMetadatas.java new file mode 100644 index 000000000000..a9d439e8cc31 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ProviderOperationsMetadatas.java @@ -0,0 +1,58 @@ +// 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 ProviderOperationsMetadatas. */ +public interface ProviderOperationsMetadatas { + /** + * Gets provider operations metadata for the specified resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @param expand Specifies whether to expand the values. + * @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 provider operations metadata for the specified resource provider along with {@link Response}. + */ + Response getWithResponse( + String resourceProviderNamespace, String expand, Context context); + + /** + * Gets provider operations metadata for the specified resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @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 provider operations metadata for the specified resource provider. + */ + ProviderOperationsMetadata get(String resourceProviderNamespace); + + /** + * Gets provider operations metadata for all resource providers. + * + * @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 provider operations metadata for all resource providers as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Gets provider operations metadata for all resource providers. + * + * @param expand Specifies whether to expand the values. + * @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 provider operations metadata for all resource providers as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String expand, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RecipientType.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RecipientType.java new file mode 100644 index 000000000000..38d1183e136c --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RecipientType.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The recipient type. */ +public final class RecipientType extends ExpandableStringEnum { + /** Static value Requestor for RecipientType. */ + public static final RecipientType REQUESTOR = fromString("Requestor"); + + /** Static value Approver for RecipientType. */ + public static final RecipientType APPROVER = fromString("Approver"); + + /** Static value Admin for RecipientType. */ + public static final RecipientType ADMIN = fromString("Admin"); + + /** + * Creates a new instance of RecipientType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RecipientType() { + } + + /** + * Creates or finds a RecipientType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RecipientType. + */ + @JsonCreator + public static RecipientType fromString(String name) { + return fromString(name, RecipientType.class); + } + + /** + * Gets known RecipientType values. + * + * @return known RecipientType values. + */ + public static Collection values() { + return values(RecipientType.class); + } +} 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 000000000000..70813fdefeeb --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RecordAllDecisionsProperties.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.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; + + /** Creates an instance of RecordAllDecisionsProperties class. */ + public RecordAllDecisionsProperties() { + } + + /** + * 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 000000000000..b3b82b89533d --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RecordAllDecisionsResult.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 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 a new instance of RecordAllDecisionsResult value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RecordAllDecisionsResult() { + } + + /** + * 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/RequestType.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RequestType.java new file mode 100644 index 000000000000..9839666d991b --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RequestType.java @@ -0,0 +1,68 @@ +// 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 the role assignment schedule request. Eg: SelfActivate, AdminAssign etc. */ +public final class RequestType extends ExpandableStringEnum { + /** Static value AdminAssign for RequestType. */ + public static final RequestType ADMIN_ASSIGN = fromString("AdminAssign"); + + /** Static value AdminRemove for RequestType. */ + public static final RequestType ADMIN_REMOVE = fromString("AdminRemove"); + + /** Static value AdminUpdate for RequestType. */ + public static final RequestType ADMIN_UPDATE = fromString("AdminUpdate"); + + /** Static value AdminExtend for RequestType. */ + public static final RequestType ADMIN_EXTEND = fromString("AdminExtend"); + + /** Static value AdminRenew for RequestType. */ + public static final RequestType ADMIN_RENEW = fromString("AdminRenew"); + + /** Static value SelfActivate for RequestType. */ + public static final RequestType SELF_ACTIVATE = fromString("SelfActivate"); + + /** Static value SelfDeactivate for RequestType. */ + public static final RequestType SELF_DEACTIVATE = fromString("SelfDeactivate"); + + /** Static value SelfExtend for RequestType. */ + public static final RequestType SELF_EXTEND = fromString("SelfExtend"); + + /** Static value SelfRenew for RequestType. */ + public static final RequestType SELF_RENEW = fromString("SelfRenew"); + + /** + * Creates a new instance of RequestType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RequestType() { + } + + /** + * Creates or finds a RequestType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RequestType. + */ + @JsonCreator + public static RequestType fromString(String name) { + return fromString(name, RequestType.class); + } + + /** + * Gets known RequestType values. + * + * @return known RequestType values. + */ + public static Collection values() { + return values(RequestType.class); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ResourceType.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ResourceType.java new file mode 100644 index 000000000000..d45ba776adec --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/ResourceType.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Resource Type. */ +@Fluent +public final class ResourceType { + /* + * The resource type name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The resource type display name. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * The resource type operations. + */ + @JsonProperty(value = "operations") + private List operations; + + /** Creates an instance of ResourceType class. */ + public ResourceType() { + } + + /** + * Get the name property: The resource type name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The resource type name. + * + * @param name the name value to set. + * @return the ResourceType object itself. + */ + public ResourceType withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: The resource type display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The resource type display name. + * + * @param displayName the displayName value to set. + * @return the ResourceType object itself. + */ + public ResourceType withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the operations property: The resource type operations. + * + * @return the operations value. + */ + public List operations() { + return this.operations; + } + + /** + * Set the operations property: The resource type operations. + * + * @param operations the operations value to set. + * @return the ResourceType object itself. + */ + public ResourceType withOperations(List operations) { + this.operations = operations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (operations() != null) { + operations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignment.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignment.java new file mode 100644 index 000000000000..96dc5c6b5727 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignment.java @@ -0,0 +1,279 @@ +// 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.RoleAssignmentInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of RoleAssignment. */ +public interface RoleAssignment { + /** + * 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 scope property: The role assignment scope. + * + * @return the scope value. + */ + String scope(); + + /** + * Gets the roleDefinitionId property: The role definition ID. + * + * @return the roleDefinitionId value. + */ + String roleDefinitionId(); + + /** + * Gets the principalId property: The principal ID. + * + * @return the principalId value. + */ + String principalId(); + + /** + * Gets the principalType property: The principal type of the assigned principal ID. + * + * @return the principalType value. + */ + PrincipalType principalType(); + + /** + * Gets the description property: Description of role assignment. + * + * @return the description value. + */ + String description(); + + /** + * Gets the condition property: The conditions on the role assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @return the condition value. + */ + String condition(); + + /** + * Gets the conditionVersion property: Version of the condition. Currently the only accepted value is '2.0'. + * + * @return the conditionVersion value. + */ + String conditionVersion(); + + /** + * Gets the createdOn property: Time it was created. + * + * @return the createdOn value. + */ + OffsetDateTime createdOn(); + + /** + * Gets the updatedOn property: Time it was updated. + * + * @return the updatedOn value. + */ + OffsetDateTime updatedOn(); + + /** + * Gets the createdBy property: Id of the user who created the assignment. + * + * @return the createdBy value. + */ + String createdBy(); + + /** + * Gets the updatedBy property: Id of the user who updated the assignment. + * + * @return the updatedBy value. + */ + String updatedBy(); + + /** + * Gets the delegatedManagedIdentityResourceId property: Id of the delegated managed identity resource. + * + * @return the delegatedManagedIdentityResourceId value. + */ + String delegatedManagedIdentityResourceId(); + + /** + * Gets the inner com.azure.resourcemanager.authorization.generated.fluent.models.RoleAssignmentInner object. + * + * @return the inner object. + */ + RoleAssignmentInner innerModel(); + + /** The entirety of the RoleAssignment definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithScope, + DefinitionStages.WithRoleDefinitionId, + DefinitionStages.WithPrincipalId, + DefinitionStages.WithCreate { + } + + /** The RoleAssignment definition stages. */ + interface DefinitionStages { + /** The first stage of the RoleAssignment definition. */ + interface Blank extends WithScope { + } + + /** The stage of the RoleAssignment definition allowing to specify parent resource. */ + interface WithScope { + /** + * Specifies scope. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @return the next definition stage. + */ + WithRoleDefinitionId withExistingScope(String scope); + } + + /** The stage of the RoleAssignment definition allowing to specify roleDefinitionId. */ + interface WithRoleDefinitionId { + /** + * Specifies the roleDefinitionId property: The role definition ID.. + * + * @param roleDefinitionId The role definition ID. + * @return the next definition stage. + */ + WithPrincipalId withRoleDefinitionId(String roleDefinitionId); + } + + /** The stage of the RoleAssignment definition allowing to specify principalId. */ + interface WithPrincipalId { + /** + * Specifies the principalId property: The principal ID.. + * + * @param principalId The principal ID. + * @return the next definition stage. + */ + WithCreate withPrincipalId(String principalId); + } + + /** + * The stage of the RoleAssignment 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.WithPrincipalType, + DefinitionStages.WithDescription, + DefinitionStages.WithCondition, + DefinitionStages.WithConditionVersion, + DefinitionStages.WithDelegatedManagedIdentityResourceId { + /** + * Executes the create request. + * + * @return the created resource. + */ + RoleAssignment create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + RoleAssignment create(Context context); + } + + /** The stage of the RoleAssignment definition allowing to specify principalType. */ + interface WithPrincipalType { + /** + * Specifies the principalType property: The principal type of the assigned principal ID.. + * + * @param principalType The principal type of the assigned principal ID. + * @return the next definition stage. + */ + WithCreate withPrincipalType(PrincipalType principalType); + } + + /** The stage of the RoleAssignment definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: Description of role assignment. + * + * @param description Description of role assignment. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + + /** The stage of the RoleAssignment definition allowing to specify condition. */ + interface WithCondition { + /** + * Specifies the condition property: The conditions on the role assignment. This limits the resources it can + * be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @param condition The conditions on the role assignment. This limits the resources it can be assigned to. + * e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * @return the next definition stage. + */ + WithCreate withCondition(String condition); + } + + /** The stage of the RoleAssignment definition allowing to specify conditionVersion. */ + interface WithConditionVersion { + /** + * Specifies the conditionVersion property: Version of the condition. Currently the only accepted value is + * '2.0'. + * + * @param conditionVersion Version of the condition. Currently the only accepted value is '2.0'. + * @return the next definition stage. + */ + WithCreate withConditionVersion(String conditionVersion); + } + + /** The stage of the RoleAssignment definition allowing to specify delegatedManagedIdentityResourceId. */ + interface WithDelegatedManagedIdentityResourceId { + /** + * Specifies the delegatedManagedIdentityResourceId property: Id of the delegated managed identity resource. + * + * @param delegatedManagedIdentityResourceId Id of the delegated managed identity resource. + * @return the next definition stage. + */ + WithCreate withDelegatedManagedIdentityResourceId(String delegatedManagedIdentityResourceId); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + RoleAssignment refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + RoleAssignment refresh(Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentCreateParameters.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentCreateParameters.java new file mode 100644 index 000000000000..e21e5838c94c --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentCreateParameters.java @@ -0,0 +1,263 @@ +// 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.util.logging.ClientLogger; +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleAssignmentProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Role assignment create parameters. */ +@Fluent +public final class RoleAssignmentCreateParameters { + /* + * Role assignment properties. + */ + @JsonProperty(value = "properties", required = true) + private RoleAssignmentProperties innerProperties = new RoleAssignmentProperties(); + + /** Creates an instance of RoleAssignmentCreateParameters class. */ + public RoleAssignmentCreateParameters() { + } + + /** + * Get the innerProperties property: Role assignment properties. + * + * @return the innerProperties value. + */ + private RoleAssignmentProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the scope property: The role assignment scope. + * + * @return the scope value. + */ + public String scope() { + return this.innerProperties() == null ? null : this.innerProperties().scope(); + } + + /** + * Get the roleDefinitionId property: The role definition ID. + * + * @return the roleDefinitionId value. + */ + public String roleDefinitionId() { + return this.innerProperties() == null ? null : this.innerProperties().roleDefinitionId(); + } + + /** + * Set the roleDefinitionId property: The role definition ID. + * + * @param roleDefinitionId the roleDefinitionId value to set. + * @return the RoleAssignmentCreateParameters object itself. + */ + public RoleAssignmentCreateParameters withRoleDefinitionId(String roleDefinitionId) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentProperties(); + } + this.innerProperties().withRoleDefinitionId(roleDefinitionId); + return this; + } + + /** + * Get the principalId property: The principal ID. + * + * @return the principalId value. + */ + public String principalId() { + return this.innerProperties() == null ? null : this.innerProperties().principalId(); + } + + /** + * Set the principalId property: The principal ID. + * + * @param principalId the principalId value to set. + * @return the RoleAssignmentCreateParameters object itself. + */ + public RoleAssignmentCreateParameters withPrincipalId(String principalId) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentProperties(); + } + this.innerProperties().withPrincipalId(principalId); + return this; + } + + /** + * Get the principalType property: The principal type of the assigned principal ID. + * + * @return the principalType value. + */ + public PrincipalType principalType() { + return this.innerProperties() == null ? null : this.innerProperties().principalType(); + } + + /** + * Set the principalType property: The principal type of the assigned principal ID. + * + * @param principalType the principalType value to set. + * @return the RoleAssignmentCreateParameters object itself. + */ + public RoleAssignmentCreateParameters withPrincipalType(PrincipalType principalType) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentProperties(); + } + this.innerProperties().withPrincipalType(principalType); + return this; + } + + /** + * Get the description property: Description of role assignment. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: Description of role assignment. + * + * @param description the description value to set. + * @return the RoleAssignmentCreateParameters object itself. + */ + public RoleAssignmentCreateParameters withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the condition property: The conditions on the role assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @return the condition value. + */ + public String condition() { + return this.innerProperties() == null ? null : this.innerProperties().condition(); + } + + /** + * Set the condition property: The conditions on the role assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @param condition the condition value to set. + * @return the RoleAssignmentCreateParameters object itself. + */ + public RoleAssignmentCreateParameters withCondition(String condition) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentProperties(); + } + this.innerProperties().withCondition(condition); + return this; + } + + /** + * Get the conditionVersion property: Version of the condition. Currently the only accepted value is '2.0'. + * + * @return the conditionVersion value. + */ + public String conditionVersion() { + return this.innerProperties() == null ? null : this.innerProperties().conditionVersion(); + } + + /** + * Set the conditionVersion property: Version of the condition. Currently the only accepted value is '2.0'. + * + * @param conditionVersion the conditionVersion value to set. + * @return the RoleAssignmentCreateParameters object itself. + */ + public RoleAssignmentCreateParameters withConditionVersion(String conditionVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentProperties(); + } + this.innerProperties().withConditionVersion(conditionVersion); + return this; + } + + /** + * Get the createdOn property: Time it was created. + * + * @return the createdOn value. + */ + public OffsetDateTime createdOn() { + return this.innerProperties() == null ? null : this.innerProperties().createdOn(); + } + + /** + * Get the updatedOn property: Time it was updated. + * + * @return the updatedOn value. + */ + public OffsetDateTime updatedOn() { + return this.innerProperties() == null ? null : this.innerProperties().updatedOn(); + } + + /** + * Get the createdBy property: Id of the user who created the assignment. + * + * @return the createdBy value. + */ + public String createdBy() { + return this.innerProperties() == null ? null : this.innerProperties().createdBy(); + } + + /** + * Get the updatedBy property: Id of the user who updated the assignment. + * + * @return the updatedBy value. + */ + public String updatedBy() { + return this.innerProperties() == null ? null : this.innerProperties().updatedBy(); + } + + /** + * Get the delegatedManagedIdentityResourceId property: Id of the delegated managed identity resource. + * + * @return the delegatedManagedIdentityResourceId value. + */ + public String delegatedManagedIdentityResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().delegatedManagedIdentityResourceId(); + } + + /** + * Set the delegatedManagedIdentityResourceId property: Id of the delegated managed identity resource. + * + * @param delegatedManagedIdentityResourceId the delegatedManagedIdentityResourceId value to set. + * @return the RoleAssignmentCreateParameters object itself. + */ + public RoleAssignmentCreateParameters withDelegatedManagedIdentityResourceId( + String delegatedManagedIdentityResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new RoleAssignmentProperties(); + } + this.innerProperties().withDelegatedManagedIdentityResourceId(delegatedManagedIdentityResourceId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model RoleAssignmentCreateParameters")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RoleAssignmentCreateParameters.class); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentListResult.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentListResult.java new file mode 100644 index 000000000000..db54bb3198da --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentListResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleAssignmentInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Role assignment list operation result. */ +@Fluent +public final class RoleAssignmentListResult { + /* + * Role assignment list. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The skipToken to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of RoleAssignmentListResult class. */ + public RoleAssignmentListResult() { + } + + /** + * Get the value property: Role assignment list. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Role assignment list. + * + * @param value the value value to set. + * @return the RoleAssignmentListResult object itself. + */ + public RoleAssignmentListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The skipToken to use for getting the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * 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/RoleAssignmentSchedule.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentSchedule.java new file mode 100644 index 000000000000..f87d84e1d7c9 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentSchedule.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.models; + +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleAssignmentScheduleInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of RoleAssignmentSchedule. */ +public interface RoleAssignmentSchedule { + /** + * Gets the id property: The role assignment schedule Id. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The role assignment schedule name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The role assignment schedule type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the scope property: The role assignment schedule scope. + * + * @return the scope value. + */ + String scope(); + + /** + * Gets the roleDefinitionId property: The role definition ID. + * + * @return the roleDefinitionId value. + */ + String roleDefinitionId(); + + /** + * Gets the principalId property: The principal ID. + * + * @return the principalId value. + */ + String principalId(); + + /** + * Gets the principalType property: The principal type of the assigned principal ID. + * + * @return the principalType value. + */ + PrincipalType principalType(); + + /** + * Gets the roleAssignmentScheduleRequestId property: The id of roleAssignmentScheduleRequest used to create this + * roleAssignmentSchedule. + * + * @return the roleAssignmentScheduleRequestId value. + */ + String roleAssignmentScheduleRequestId(); + + /** + * Gets the linkedRoleEligibilityScheduleId property: The id of roleEligibilitySchedule used to activated this + * roleAssignmentSchedule. + * + * @return the linkedRoleEligibilityScheduleId value. + */ + String linkedRoleEligibilityScheduleId(); + + /** + * Gets the assignmentType property: Assignment type of the role assignment schedule. + * + * @return the assignmentType value. + */ + AssignmentType assignmentType(); + + /** + * Gets the memberType property: Membership type of the role assignment schedule. + * + * @return the memberType value. + */ + MemberType memberType(); + + /** + * Gets the status property: The status of the role assignment schedule. + * + * @return the status value. + */ + Status status(); + + /** + * Gets the startDateTime property: Start DateTime when role assignment schedule. + * + * @return the startDateTime value. + */ + OffsetDateTime startDateTime(); + + /** + * Gets the endDateTime property: End DateTime when role assignment schedule. + * + * @return the endDateTime value. + */ + OffsetDateTime endDateTime(); + + /** + * Gets the condition property: The conditions on the role assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @return the condition value. + */ + String condition(); + + /** + * Gets the conditionVersion property: Version of the condition. Currently accepted value is '2.0'. + * + * @return the conditionVersion value. + */ + String conditionVersion(); + + /** + * Gets the createdOn property: DateTime when role assignment schedule was created. + * + * @return the createdOn value. + */ + OffsetDateTime createdOn(); + + /** + * Gets the updatedOn property: DateTime when role assignment schedule was modified. + * + * @return the updatedOn value. + */ + OffsetDateTime updatedOn(); + + /** + * Gets the expandedProperties property: Additional properties of principal, scope and role definition. + * + * @return the expandedProperties value. + */ + ExpandedProperties expandedProperties(); + + /** + * Gets the inner com.azure.resourcemanager.authorization.generated.fluent.models.RoleAssignmentScheduleInner + * object. + * + * @return the inner object. + */ + RoleAssignmentScheduleInner innerModel(); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentScheduleInstance.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentScheduleInstance.java new file mode 100644 index 000000000000..9206ea08e79d --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentScheduleInstance.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.RoleAssignmentScheduleInstanceInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of RoleAssignmentScheduleInstance. */ +public interface RoleAssignmentScheduleInstance { + /** + * Gets the id property: The role assignment schedule instance ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The role assignment schedule instance name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The role assignment schedule instance type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the scope property: The role assignment schedule scope. + * + * @return the scope value. + */ + String scope(); + + /** + * Gets the roleDefinitionId property: The role definition ID. + * + * @return the roleDefinitionId value. + */ + String roleDefinitionId(); + + /** + * Gets the principalId property: The principal ID. + * + * @return the principalId value. + */ + String principalId(); + + /** + * Gets the principalType property: The principal type of the assigned principal ID. + * + * @return the principalType value. + */ + PrincipalType principalType(); + + /** + * Gets the roleAssignmentScheduleId property: Id of the master role assignment schedule. + * + * @return the roleAssignmentScheduleId value. + */ + String roleAssignmentScheduleId(); + + /** + * Gets the originRoleAssignmentId property: Role Assignment Id in external system. + * + * @return the originRoleAssignmentId value. + */ + String originRoleAssignmentId(); + + /** + * Gets the status property: The status of the role assignment schedule instance. + * + * @return the status value. + */ + Status status(); + + /** + * Gets the startDateTime property: The startDateTime of the role assignment schedule instance. + * + * @return the startDateTime value. + */ + OffsetDateTime startDateTime(); + + /** + * Gets the endDateTime property: The endDateTime of the role assignment schedule instance. + * + * @return the endDateTime value. + */ + OffsetDateTime endDateTime(); + + /** + * Gets the linkedRoleEligibilityScheduleId property: roleEligibilityScheduleId used to activate. + * + * @return the linkedRoleEligibilityScheduleId value. + */ + String linkedRoleEligibilityScheduleId(); + + /** + * Gets the linkedRoleEligibilityScheduleInstanceId property: roleEligibilityScheduleInstanceId linked to this + * roleAssignmentScheduleInstance. + * + * @return the linkedRoleEligibilityScheduleInstanceId value. + */ + String linkedRoleEligibilityScheduleInstanceId(); + + /** + * Gets the assignmentType property: Assignment type of the role assignment schedule. + * + * @return the assignmentType value. + */ + AssignmentType assignmentType(); + + /** + * Gets the memberType property: Membership type of the role assignment schedule. + * + * @return the memberType value. + */ + MemberType memberType(); + + /** + * Gets the condition property: The conditions on the role assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @return the condition value. + */ + String condition(); + + /** + * Gets the conditionVersion property: Version of the condition. Currently accepted value is '2.0'. + * + * @return the conditionVersion value. + */ + String conditionVersion(); + + /** + * Gets the createdOn property: DateTime when role assignment schedule was created. + * + * @return the createdOn value. + */ + OffsetDateTime createdOn(); + + /** + * Gets the expandedProperties property: Additional properties of principal, scope and role definition. + * + * @return the expandedProperties value. + */ + ExpandedProperties expandedProperties(); + + /** + * Gets the inner + * com.azure.resourcemanager.authorization.generated.fluent.models.RoleAssignmentScheduleInstanceInner object. + * + * @return the inner object. + */ + RoleAssignmentScheduleInstanceInner innerModel(); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentScheduleInstanceListResult.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentScheduleInstanceListResult.java new file mode 100644 index 000000000000..2dc3a7496608 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentScheduleInstanceListResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleAssignmentScheduleInstanceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Role assignment schedule instance list operation result. */ +@Fluent +public final class RoleAssignmentScheduleInstanceListResult { + /* + * Role assignment schedule 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; + + /** Creates an instance of RoleAssignmentScheduleInstanceListResult class. */ + public RoleAssignmentScheduleInstanceListResult() { + } + + /** + * Get the value property: Role assignment schedule instance list. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Role assignment schedule instance list. + * + * @param value the value value to set. + * @return the RoleAssignmentScheduleInstanceListResult object itself. + */ + public RoleAssignmentScheduleInstanceListResult 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 RoleAssignmentScheduleInstanceListResult object itself. + */ + public RoleAssignmentScheduleInstanceListResult 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/RoleAssignmentScheduleInstances.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentScheduleInstances.java new file mode 100644 index 000000000000..925749833478 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentScheduleInstances.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.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 RoleAssignmentScheduleInstances. */ +public interface RoleAssignmentScheduleInstances { + /** + * Gets role assignment schedule instances of a role assignment schedule. + * + * @param scope The scope of the role assignment schedule. + * @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 role assignment schedule instances of a role assignment schedule as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listForScope(String scope); + + /** + * Gets role assignment schedule instances of a role assignment schedule. + * + * @param scope The scope of the role assignment schedule. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + * at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or + * below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment + * schedule instances for the user. Use $filter=asTarget() to return all role assignment schedule instances + * created for the current user. + * @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 role assignment schedule instances of a role assignment schedule as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listForScope(String scope, String filter, Context context); + + /** + * Gets the specified role assignment schedule instance. + * + * @param scope The scope of the role assignments schedules. + * @param roleAssignmentScheduleInstanceName The name (hash of schedule name + time) of the role assignment schedule + * to get. + * @param 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 specified role assignment schedule instance along with {@link Response}. + */ + Response getWithResponse( + String scope, String roleAssignmentScheduleInstanceName, Context context); + + /** + * Gets the specified role assignment schedule instance. + * + * @param scope The scope of the role assignments schedules. + * @param roleAssignmentScheduleInstanceName The name (hash of schedule name + time) of the role assignment schedule + * to get. + * @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 specified role assignment schedule instance. + */ + RoleAssignmentScheduleInstance get(String scope, String roleAssignmentScheduleInstanceName); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentScheduleListResult.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentScheduleListResult.java new file mode 100644 index 000000000000..3cd9f080bd62 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentScheduleListResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleAssignmentScheduleInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Role assignment schedule list operation result. */ +@Fluent +public final class RoleAssignmentScheduleListResult { + /* + * Role assignment schedule list. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of RoleAssignmentScheduleListResult class. */ + public RoleAssignmentScheduleListResult() { + } + + /** + * Get the value property: Role assignment schedule list. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Role assignment schedule list. + * + * @param value the value value to set. + * @return the RoleAssignmentScheduleListResult object itself. + */ + public RoleAssignmentScheduleListResult 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 RoleAssignmentScheduleListResult object itself. + */ + public RoleAssignmentScheduleListResult 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/RoleAssignmentScheduleRequest.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentScheduleRequest.java new file mode 100644 index 000000000000..a339eb71ba3d --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentScheduleRequest.java @@ -0,0 +1,430 @@ +// 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.RoleAssignmentScheduleRequestInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of RoleAssignmentScheduleRequest. */ +public interface RoleAssignmentScheduleRequest { + /** + * Gets the id property: The role assignment schedule request ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The role assignment schedule request name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The role assignment schedule request type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the scope property: The role assignment schedule request scope. + * + * @return the scope value. + */ + String scope(); + + /** + * Gets the roleDefinitionId property: The role definition ID. + * + * @return the roleDefinitionId value. + */ + String roleDefinitionId(); + + /** + * Gets the principalId property: The principal ID. + * + * @return the principalId value. + */ + String principalId(); + + /** + * Gets the principalType property: The principal type of the assigned principal ID. + * + * @return the principalType value. + */ + PrincipalType principalType(); + + /** + * Gets the requestType property: The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign + * etc. + * + * @return the requestType value. + */ + RequestType requestType(); + + /** + * Gets the status property: The status of the role assignment schedule request. + * + * @return the status value. + */ + Status status(); + + /** + * Gets the approvalId property: The approvalId of the role assignment schedule request. + * + * @return the approvalId value. + */ + String approvalId(); + + /** + * Gets the targetRoleAssignmentScheduleId property: The resultant role assignment schedule id or the role + * assignment schedule id being updated. + * + * @return the targetRoleAssignmentScheduleId value. + */ + String targetRoleAssignmentScheduleId(); + + /** + * Gets the targetRoleAssignmentScheduleInstanceId property: The role assignment schedule instance id being updated. + * + * @return the targetRoleAssignmentScheduleInstanceId value. + */ + String targetRoleAssignmentScheduleInstanceId(); + + /** + * Gets the scheduleInfo property: Schedule info of the role assignment schedule. + * + * @return the scheduleInfo value. + */ + RoleAssignmentScheduleRequestPropertiesScheduleInfo scheduleInfo(); + + /** + * Gets the linkedRoleEligibilityScheduleId property: The linked role eligibility schedule id - to activate an + * eligibility. + * + * @return the linkedRoleEligibilityScheduleId value. + */ + String linkedRoleEligibilityScheduleId(); + + /** + * Gets the justification property: Justification for the role assignment. + * + * @return the justification value. + */ + String justification(); + + /** + * Gets the ticketInfo property: Ticket Info of the role assignment. + * + * @return the ticketInfo value. + */ + RoleAssignmentScheduleRequestPropertiesTicketInfo ticketInfo(); + + /** + * Gets the condition property: The conditions on the role assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @return the condition value. + */ + String condition(); + + /** + * Gets the conditionVersion property: Version of the condition. Currently accepted value is '2.0'. + * + * @return the conditionVersion value. + */ + String conditionVersion(); + + /** + * Gets the createdOn property: DateTime when role assignment schedule request was created. + * + * @return the createdOn value. + */ + OffsetDateTime createdOn(); + + /** + * Gets the requestorId property: Id of the user who created this request. + * + * @return the requestorId value. + */ + String requestorId(); + + /** + * Gets the expandedProperties property: Additional properties of principal, scope and role definition. + * + * @return the expandedProperties value. + */ + ExpandedProperties expandedProperties(); + + /** + * Gets the inner com.azure.resourcemanager.authorization.generated.fluent.models.RoleAssignmentScheduleRequestInner + * object. + * + * @return the inner object. + */ + RoleAssignmentScheduleRequestInner innerModel(); + + /** The entirety of the RoleAssignmentScheduleRequest definition. */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScope, DefinitionStages.WithCreate { + } + + /** The RoleAssignmentScheduleRequest definition stages. */ + interface DefinitionStages { + /** The first stage of the RoleAssignmentScheduleRequest definition. */ + interface Blank extends WithScope { + } + + /** The stage of the RoleAssignmentScheduleRequest definition allowing to specify parent resource. */ + interface WithScope { + /** + * Specifies scope. + * + * @param scope The scope of the role assignment schedule request to create. The scope can be any REST + * resource instance. For example, use + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' + * for a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @return the next definition stage. + */ + WithCreate withExistingScope(String scope); + } + + /** + * The stage of the RoleAssignmentScheduleRequest 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.WithRoleDefinitionId, + DefinitionStages.WithPrincipalId, + DefinitionStages.WithRequestType, + DefinitionStages.WithTargetRoleAssignmentScheduleId, + DefinitionStages.WithTargetRoleAssignmentScheduleInstanceId, + DefinitionStages.WithScheduleInfo, + DefinitionStages.WithLinkedRoleEligibilityScheduleId, + DefinitionStages.WithJustification, + DefinitionStages.WithTicketInfo, + DefinitionStages.WithCondition, + DefinitionStages.WithConditionVersion { + /** + * Executes the create request. + * + * @return the created resource. + */ + RoleAssignmentScheduleRequest create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + RoleAssignmentScheduleRequest create(Context context); + } + + /** The stage of the RoleAssignmentScheduleRequest definition allowing to specify roleDefinitionId. */ + interface WithRoleDefinitionId { + /** + * Specifies the roleDefinitionId property: The role definition ID.. + * + * @param roleDefinitionId The role definition ID. + * @return the next definition stage. + */ + WithCreate withRoleDefinitionId(String roleDefinitionId); + } + + /** The stage of the RoleAssignmentScheduleRequest definition allowing to specify principalId. */ + interface WithPrincipalId { + /** + * Specifies the principalId property: The principal ID.. + * + * @param principalId The principal ID. + * @return the next definition stage. + */ + WithCreate withPrincipalId(String principalId); + } + + /** The stage of the RoleAssignmentScheduleRequest definition allowing to specify requestType. */ + interface WithRequestType { + /** + * Specifies the requestType property: The type of the role assignment schedule request. Eg: SelfActivate, + * AdminAssign etc. + * + * @param requestType The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc. + * @return the next definition stage. + */ + WithCreate withRequestType(RequestType requestType); + } + + /** + * The stage of the RoleAssignmentScheduleRequest definition allowing to specify targetRoleAssignmentScheduleId. + */ + interface WithTargetRoleAssignmentScheduleId { + /** + * Specifies the targetRoleAssignmentScheduleId property: The resultant role assignment schedule id or the + * role assignment schedule id being updated. + * + * @param targetRoleAssignmentScheduleId The resultant role assignment schedule id or the role assignment + * schedule id being updated. + * @return the next definition stage. + */ + WithCreate withTargetRoleAssignmentScheduleId(String targetRoleAssignmentScheduleId); + } + + /** + * The stage of the RoleAssignmentScheduleRequest definition allowing to specify + * targetRoleAssignmentScheduleInstanceId. + */ + interface WithTargetRoleAssignmentScheduleInstanceId { + /** + * Specifies the targetRoleAssignmentScheduleInstanceId property: The role assignment schedule instance id + * being updated. + * + * @param targetRoleAssignmentScheduleInstanceId The role assignment schedule instance id being updated. + * @return the next definition stage. + */ + WithCreate withTargetRoleAssignmentScheduleInstanceId(String targetRoleAssignmentScheduleInstanceId); + } + + /** The stage of the RoleAssignmentScheduleRequest definition allowing to specify scheduleInfo. */ + interface WithScheduleInfo { + /** + * Specifies the scheduleInfo property: Schedule info of the role assignment schedule. + * + * @param scheduleInfo Schedule info of the role assignment schedule. + * @return the next definition stage. + */ + WithCreate withScheduleInfo(RoleAssignmentScheduleRequestPropertiesScheduleInfo scheduleInfo); + } + + /** + * The stage of the RoleAssignmentScheduleRequest definition allowing to specify + * linkedRoleEligibilityScheduleId. + */ + interface WithLinkedRoleEligibilityScheduleId { + /** + * Specifies the linkedRoleEligibilityScheduleId property: The linked role eligibility schedule id - to + * activate an eligibility.. + * + * @param linkedRoleEligibilityScheduleId The linked role eligibility schedule id - to activate an + * eligibility. + * @return the next definition stage. + */ + WithCreate withLinkedRoleEligibilityScheduleId(String linkedRoleEligibilityScheduleId); + } + + /** The stage of the RoleAssignmentScheduleRequest definition allowing to specify justification. */ + interface WithJustification { + /** + * Specifies the justification property: Justification for the role assignment. + * + * @param justification Justification for the role assignment. + * @return the next definition stage. + */ + WithCreate withJustification(String justification); + } + + /** The stage of the RoleAssignmentScheduleRequest definition allowing to specify ticketInfo. */ + interface WithTicketInfo { + /** + * Specifies the ticketInfo property: Ticket Info of the role assignment. + * + * @param ticketInfo Ticket Info of the role assignment. + * @return the next definition stage. + */ + WithCreate withTicketInfo(RoleAssignmentScheduleRequestPropertiesTicketInfo ticketInfo); + } + + /** The stage of the RoleAssignmentScheduleRequest definition allowing to specify condition. */ + interface WithCondition { + /** + * Specifies the condition property: The conditions on the role assignment. This limits the resources it can + * be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @param condition The conditions on the role assignment. This limits the resources it can be assigned to. + * e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * @return the next definition stage. + */ + WithCreate withCondition(String condition); + } + + /** The stage of the RoleAssignmentScheduleRequest definition allowing to specify conditionVersion. */ + interface WithConditionVersion { + /** + * Specifies the conditionVersion property: Version of the condition. Currently accepted value is '2.0'. + * + * @param conditionVersion Version of the condition. Currently accepted value is '2.0'. + * @return the next definition stage. + */ + WithCreate withConditionVersion(String conditionVersion); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + RoleAssignmentScheduleRequest refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + RoleAssignmentScheduleRequest refresh(Context context); + + /** + * Cancels a pending role assignment schedule request. + * + * @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 cancelWithResponse(Context context); + + /** + * Cancels a pending role assignment schedule request. + * + * @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 cancel(); + + /** + * Validates a new role assignment schedule request. + * + * @param parameters Parameters for the role assignment schedule request. + * @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 role Assignment schedule request along with {@link Response}. + */ + Response validateWithResponse( + RoleAssignmentScheduleRequestInner parameters, Context context); + + /** + * Validates a new role assignment schedule request. + * + * @param parameters Parameters for the role assignment schedule request. + * @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 role Assignment schedule request. + */ + RoleAssignmentScheduleRequest validate(RoleAssignmentScheduleRequestInner parameters); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentScheduleRequestListResult.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentScheduleRequestListResult.java new file mode 100644 index 000000000000..62e19cc094f4 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentScheduleRequestListResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleAssignmentScheduleRequestInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Role assignment schedule request list operation result. */ +@Fluent +public final class RoleAssignmentScheduleRequestListResult { + /* + * Role assignment schedule request list. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of RoleAssignmentScheduleRequestListResult class. */ + public RoleAssignmentScheduleRequestListResult() { + } + + /** + * Get the value property: Role assignment schedule request list. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Role assignment schedule request list. + * + * @param value the value value to set. + * @return the RoleAssignmentScheduleRequestListResult object itself. + */ + public RoleAssignmentScheduleRequestListResult 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 RoleAssignmentScheduleRequestListResult object itself. + */ + public RoleAssignmentScheduleRequestListResult 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/RoleAssignmentScheduleRequestPropertiesScheduleInfo.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentScheduleRequestPropertiesScheduleInfo.java new file mode 100644 index 000000000000..d692cd6534ba --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentScheduleRequestPropertiesScheduleInfo.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Schedule info of the role assignment schedule. */ +@Fluent +public final class RoleAssignmentScheduleRequestPropertiesScheduleInfo { + /* + * Start DateTime of the role assignment schedule. + */ + @JsonProperty(value = "startDateTime") + private OffsetDateTime startDateTime; + + /* + * Expiration of the role assignment schedule + */ + @JsonProperty(value = "expiration") + private RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration expiration; + + /** Creates an instance of RoleAssignmentScheduleRequestPropertiesScheduleInfo class. */ + public RoleAssignmentScheduleRequestPropertiesScheduleInfo() { + } + + /** + * Get the startDateTime property: Start DateTime of the role assignment schedule. + * + * @return the startDateTime value. + */ + public OffsetDateTime startDateTime() { + return this.startDateTime; + } + + /** + * Set the startDateTime property: Start DateTime of the role assignment schedule. + * + * @param startDateTime the startDateTime value to set. + * @return the RoleAssignmentScheduleRequestPropertiesScheduleInfo object itself. + */ + public RoleAssignmentScheduleRequestPropertiesScheduleInfo withStartDateTime(OffsetDateTime startDateTime) { + this.startDateTime = startDateTime; + return this; + } + + /** + * Get the expiration property: Expiration of the role assignment schedule. + * + * @return the expiration value. + */ + public RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration expiration() { + return this.expiration; + } + + /** + * Set the expiration property: Expiration of the role assignment schedule. + * + * @param expiration the expiration value to set. + * @return the RoleAssignmentScheduleRequestPropertiesScheduleInfo object itself. + */ + public RoleAssignmentScheduleRequestPropertiesScheduleInfo withExpiration( + RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration expiration) { + this.expiration = expiration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (expiration() != null) { + expiration().validate(); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.java new file mode 100644 index 000000000000..6fb59fe42165 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration.java @@ -0,0 +1,103 @@ +// 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; +import java.time.OffsetDateTime; + +/** Expiration of the role assignment schedule. */ +@Fluent +public final class RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration { + /* + * Type of the role assignment schedule expiration + */ + @JsonProperty(value = "type") + private Type type; + + /* + * End DateTime of the role assignment schedule. + */ + @JsonProperty(value = "endDateTime") + private OffsetDateTime endDateTime; + + /* + * Duration of the role assignment schedule in TimeSpan. + */ + @JsonProperty(value = "duration") + private String duration; + + /** Creates an instance of RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration class. */ + public RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration() { + } + + /** + * Get the type property: Type of the role assignment schedule expiration. + * + * @return the type value. + */ + public Type type() { + return this.type; + } + + /** + * Set the type property: Type of the role assignment schedule expiration. + * + * @param type the type value to set. + * @return the RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration object itself. + */ + public RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration withType(Type type) { + this.type = type; + return this; + } + + /** + * Get the endDateTime property: End DateTime of the role assignment schedule. + * + * @return the endDateTime value. + */ + public OffsetDateTime endDateTime() { + return this.endDateTime; + } + + /** + * Set the endDateTime property: End DateTime of the role assignment schedule. + * + * @param endDateTime the endDateTime value to set. + * @return the RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration object itself. + */ + public RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration withEndDateTime(OffsetDateTime endDateTime) { + this.endDateTime = endDateTime; + return this; + } + + /** + * Get the duration property: Duration of the role assignment schedule in TimeSpan. + * + * @return the duration value. + */ + public String duration() { + return this.duration; + } + + /** + * Set the duration property: Duration of the role assignment schedule in TimeSpan. + * + * @param duration the duration value to set. + * @return the RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration object itself. + */ + public RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration withDuration(String duration) { + this.duration = duration; + 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/RoleAssignmentScheduleRequestPropertiesTicketInfo.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentScheduleRequestPropertiesTicketInfo.java new file mode 100644 index 000000000000..4a351d1c9b4a --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentScheduleRequestPropertiesTicketInfo.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Ticket Info of the role assignment. */ +@Fluent +public final class RoleAssignmentScheduleRequestPropertiesTicketInfo { + /* + * Ticket number for the role assignment + */ + @JsonProperty(value = "ticketNumber") + private String ticketNumber; + + /* + * Ticket system name for the role assignment + */ + @JsonProperty(value = "ticketSystem") + private String ticketSystem; + + /** Creates an instance of RoleAssignmentScheduleRequestPropertiesTicketInfo class. */ + public RoleAssignmentScheduleRequestPropertiesTicketInfo() { + } + + /** + * Get the ticketNumber property: Ticket number for the role assignment. + * + * @return the ticketNumber value. + */ + public String ticketNumber() { + return this.ticketNumber; + } + + /** + * Set the ticketNumber property: Ticket number for the role assignment. + * + * @param ticketNumber the ticketNumber value to set. + * @return the RoleAssignmentScheduleRequestPropertiesTicketInfo object itself. + */ + public RoleAssignmentScheduleRequestPropertiesTicketInfo withTicketNumber(String ticketNumber) { + this.ticketNumber = ticketNumber; + return this; + } + + /** + * Get the ticketSystem property: Ticket system name for the role assignment. + * + * @return the ticketSystem value. + */ + public String ticketSystem() { + return this.ticketSystem; + } + + /** + * Set the ticketSystem property: Ticket system name for the role assignment. + * + * @param ticketSystem the ticketSystem value to set. + * @return the RoleAssignmentScheduleRequestPropertiesTicketInfo object itself. + */ + public RoleAssignmentScheduleRequestPropertiesTicketInfo withTicketSystem(String ticketSystem) { + this.ticketSystem = ticketSystem; + 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/RoleAssignmentScheduleRequests.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentScheduleRequests.java new file mode 100644 index 000000000000..af396e94abc6 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentScheduleRequests.java @@ -0,0 +1,155 @@ +// 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.RoleAssignmentScheduleRequestInner; + +/** Resource collection API of RoleAssignmentScheduleRequests. */ +public interface RoleAssignmentScheduleRequests { + /** + * Get the specified role assignment schedule request. + * + * @param scope The scope of the role assignment schedule request. + * @param roleAssignmentScheduleRequestName The name (guid) of the role assignment schedule request to get. + * @param 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 specified role assignment schedule request along with {@link Response}. + */ + Response getWithResponse( + String scope, String roleAssignmentScheduleRequestName, Context context); + + /** + * Get the specified role assignment schedule request. + * + * @param scope The scope of the role assignment schedule request. + * @param roleAssignmentScheduleRequestName The name (guid) of the role assignment schedule request to get. + * @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 specified role assignment schedule request. + */ + RoleAssignmentScheduleRequest get(String scope, String roleAssignmentScheduleRequestName); + + /** + * Gets role assignment schedule requests for a scope. + * + * @param scope The scope of the role assignments schedule requests. + * @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 role assignment schedule requests for a scope as paginated response with {@link PagedIterable}. + */ + PagedIterable listForScope(String scope); + + /** + * Gets role assignment schedule requests for a scope. + * + * @param scope The scope of the role assignments schedule requests. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedule + * requests at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedule + * requests at, above or below the scope for the specified principal. Use $filter=asRequestor() to return all + * role assignment schedule requests requested by the current user. Use $filter=asTarget() to return all role + * assignment schedule requests created for the current user. Use $filter=asApprover() to return all role + * assignment schedule requests where the current user is an approver. + * @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 role assignment schedule requests for a scope as paginated response with {@link PagedIterable}. + */ + PagedIterable listForScope(String scope, String filter, Context context); + + /** + * Cancels a pending role assignment schedule request. + * + * @param scope The scope of the role assignment request to cancel. + * @param roleAssignmentScheduleRequestName The name of the role assignment request to cancel. + * @param 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 cancelWithResponse(String scope, String roleAssignmentScheduleRequestName, Context context); + + /** + * Cancels a pending role assignment schedule request. + * + * @param scope The scope of the role assignment request to cancel. + * @param roleAssignmentScheduleRequestName The name of the role assignment request to cancel. + * @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 cancel(String scope, String roleAssignmentScheduleRequestName); + + /** + * Validates a new role assignment schedule request. + * + * @param scope The scope of the role assignment request to validate. + * @param roleAssignmentScheduleRequestName The name of the role assignment request to validate. + * @param parameters Parameters for the role assignment schedule request. + * @param 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 role Assignment schedule request along with {@link Response}. + */ + Response validateWithResponse( + String scope, + String roleAssignmentScheduleRequestName, + RoleAssignmentScheduleRequestInner parameters, + Context context); + + /** + * Validates a new role assignment schedule request. + * + * @param scope The scope of the role assignment request to validate. + * @param roleAssignmentScheduleRequestName The name of the role assignment request to validate. + * @param parameters Parameters for the role assignment schedule request. + * @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 role Assignment schedule request. + */ + RoleAssignmentScheduleRequest validate( + String scope, String roleAssignmentScheduleRequestName, RoleAssignmentScheduleRequestInner parameters); + + /** + * Get the specified role assignment schedule request. + * + * @param id the resource ID. + * @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 specified role assignment schedule request along with {@link Response}. + */ + RoleAssignmentScheduleRequest getById(String id); + + /** + * Get the specified role assignment schedule request. + * + * @param id the resource ID. + * @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 specified role assignment schedule request along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new RoleAssignmentScheduleRequest resource. + * + * @param name resource name. + * @return the first stage of the new RoleAssignmentScheduleRequest definition. + */ + RoleAssignmentScheduleRequest.DefinitionStages.Blank define(String name); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentSchedules.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentSchedules.java new file mode 100644 index 000000000000..ff13646deb44 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignmentSchedules.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 RoleAssignmentSchedules. */ +public interface RoleAssignmentSchedules { + /** + * Get the specified role assignment schedule for a resource scope. + * + * @param scope The scope of the role assignment schedule. + * @param roleAssignmentScheduleName The name (guid) of the role assignment schedule to get. + * @param 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 specified role assignment schedule for a resource scope along with {@link Response}. + */ + Response getWithResponse(String scope, String roleAssignmentScheduleName, Context context); + + /** + * Get the specified role assignment schedule for a resource scope. + * + * @param scope The scope of the role assignment schedule. + * @param roleAssignmentScheduleName The name (guid) of the role assignment schedule to get. + * @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 specified role assignment schedule for a resource scope. + */ + RoleAssignmentSchedule get(String scope, String roleAssignmentScheduleName); + + /** + * Gets role assignment schedules for a resource scope. + * + * @param scope The scope of the role assignments schedules. + * @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 role assignment schedules for a resource scope as paginated response with {@link PagedIterable}. + */ + PagedIterable listForScope(String scope); + + /** + * Gets role assignment schedules for a resource scope. + * + * @param scope The scope of the role assignments schedules. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + * at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or + * below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment + * schedules for the current user. Use $filter=asTarget() to return all role assignment schedules created for + * the current user. + * @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 role assignment schedules for a resource scope as paginated response with {@link PagedIterable}. + */ + PagedIterable listForScope(String scope, String filter, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignments.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignments.java new file mode 100644 index 000000000000..2a458ea5f044 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleAssignments.java @@ -0,0 +1,308 @@ +// 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 RoleAssignments. */ +public interface RoleAssignments { + /** + * List all role assignments that apply to a 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 role assignment list operation result as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List all role assignments that apply to a subscription. + * + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or + * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope + * for the specified principal. + * @param tenantId Tenant ID for cross-tenant request. + * @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 role assignment list operation result as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String filter, String tenantId, Context context); + + /** + * List all role assignments that apply to a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 role assignment list operation result as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List all role assignments that apply to a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or + * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope + * for the specified principal. + * @param tenantId Tenant ID for cross-tenant request. + * @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 role assignment list operation result as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup( + String resourceGroupName, String filter, String tenantId, Context context); + + /** + * List all role assignments that apply to a resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from + * Microsoft.Web/sites). + * @param resourceName The resource name. + * @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 role assignment list operation result as paginated response with {@link PagedIterable}. + */ + PagedIterable listForResource( + String resourceGroupName, String resourceProviderNamespace, String resourceType, String resourceName); + + /** + * List all role assignments that apply to a resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from + * Microsoft.Web/sites). + * @param resourceName The resource name. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or + * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope + * for the specified principal. + * @param tenantId Tenant ID for cross-tenant request. + * @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 role assignment list operation result as paginated response with {@link PagedIterable}. + */ + PagedIterable listForResource( + String resourceGroupName, + String resourceProviderNamespace, + String resourceType, + String resourceName, + String filter, + String tenantId, + Context context); + + /** + * Get a role assignment by scope and name. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. + * @param tenantId Tenant ID for cross-tenant request. + * @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 a role assignment by scope and name along with {@link Response}. + */ + Response getWithResponse(String scope, String roleAssignmentName, String tenantId, Context context); + + /** + * Get a role assignment by scope and name. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. + * @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 a role assignment by scope and name. + */ + RoleAssignment get(String scope, String roleAssignmentName); + + /** + * Delete a role assignment by scope and name. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. + * @param tenantId Tenant ID for cross-tenant request. + * @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 role Assignments along with {@link Response}. + */ + Response deleteWithResponse( + String scope, String roleAssignmentName, String tenantId, Context context); + + /** + * Delete a role assignment by scope and name. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. + * @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 role Assignments. + */ + RoleAssignment delete(String scope, String roleAssignmentName); + + /** + * List all role assignments that apply to a scope. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @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 role assignment list operation result as paginated response with {@link PagedIterable}. + */ + PagedIterable listForScope(String scope); + + /** + * List all role assignments that apply to a scope. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or + * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope + * for the specified principal. + * @param tenantId Tenant ID for cross-tenant request. + * @param skipToken The skipToken to apply on the operation. Use $skipToken={skiptoken} to return paged role + * assignments following the skipToken passed. Only supported on provider level calls. + * @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 role assignment list operation result as paginated response with {@link PagedIterable}. + */ + PagedIterable listForScope( + String scope, String filter, String tenantId, String skipToken, Context context); + + /** + * Get a role assignment by ID. + * + * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource name, and + * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + * Example: + * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. + * @param tenantId Tenant ID for cross-tenant request. + * @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 a role assignment by ID along with {@link Response}. + */ + Response getByIdWithResponse(String roleAssignmentId, String tenantId, Context context); + + /** + * Get a role assignment by ID. + * + * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource name, and + * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + * Example: + * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. + * @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 a role assignment by ID. + */ + RoleAssignment getById(String roleAssignmentId); + + /** + * Create or update a role assignment by ID. + * + * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource name, and + * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + * Example: + * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. + * @param parameters Parameters for the role assignment. + * @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 role Assignments along with {@link Response}. + */ + Response createByIdWithResponse( + String roleAssignmentId, RoleAssignmentCreateParameters parameters, Context context); + + /** + * Create or update a role assignment by ID. + * + * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource name, and + * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + * Example: + * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. + * @param parameters Parameters for the role assignment. + * @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 role Assignments. + */ + RoleAssignment createById(String roleAssignmentId, RoleAssignmentCreateParameters parameters); + + /** + * Delete a role assignment by ID. + * + * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource name, and + * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + * Example: + * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. + * @param tenantId Tenant ID for cross-tenant request. + * @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 role Assignments along with {@link Response}. + */ + Response deleteByIdWithResponse(String roleAssignmentId, String tenantId, Context context); + + /** + * Delete a role assignment by ID. + * + * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource name, and + * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. + * Example: + * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. + * @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 role Assignments. + */ + RoleAssignment deleteById(String roleAssignmentId); + + /** + * Begins definition for a new RoleAssignment resource. + * + * @param name resource name. + * @return the first stage of the new RoleAssignment definition. + */ + RoleAssignment.DefinitionStages.Blank define(String name); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleDefinition.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleDefinition.java new file mode 100644 index 000000000000..d5c6d6c64ae3 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleDefinition.java @@ -0,0 +1,314 @@ +// 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.PermissionInner; +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleDefinitionInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of RoleDefinition. */ +public interface RoleDefinition { + /** + * 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 roleName property: The role name. + * + * @return the roleName value. + */ + String roleName(); + + /** + * Gets the description property: The role definition description. + * + * @return the description value. + */ + String description(); + + /** + * Gets the roleType property: The role type. + * + * @return the roleType value. + */ + String roleType(); + + /** + * Gets the permissions property: Role definition permissions. + * + * @return the permissions value. + */ + List permissions(); + + /** + * Gets the assignableScopes property: Role definition assignable scopes. + * + * @return the assignableScopes value. + */ + List assignableScopes(); + + /** + * Gets the createdOn property: Time it was created. + * + * @return the createdOn value. + */ + OffsetDateTime createdOn(); + + /** + * Gets the updatedOn property: Time it was updated. + * + * @return the updatedOn value. + */ + OffsetDateTime updatedOn(); + + /** + * Gets the createdBy property: Id of the user who created the assignment. + * + * @return the createdBy value. + */ + String createdBy(); + + /** + * Gets the updatedBy property: Id of the user who updated the assignment. + * + * @return the updatedBy value. + */ + String updatedBy(); + + /** + * Gets the inner com.azure.resourcemanager.authorization.generated.fluent.models.RoleDefinitionInner object. + * + * @return the inner object. + */ + RoleDefinitionInner innerModel(); + + /** The entirety of the RoleDefinition definition. */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScope, DefinitionStages.WithCreate { + } + + /** The RoleDefinition definition stages. */ + interface DefinitionStages { + /** The first stage of the RoleDefinition definition. */ + interface Blank extends WithScope { + } + + /** The stage of the RoleDefinition definition allowing to specify parent resource. */ + interface WithScope { + /** + * Specifies scope. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @return the next definition stage. + */ + WithCreate withExistingScope(String scope); + } + + /** + * The stage of the RoleDefinition 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.WithRoleName, + DefinitionStages.WithDescription, + DefinitionStages.WithRoleType, + DefinitionStages.WithPermissions, + DefinitionStages.WithAssignableScopes { + /** + * Executes the create request. + * + * @return the created resource. + */ + RoleDefinition create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + RoleDefinition create(Context context); + } + + /** The stage of the RoleDefinition definition allowing to specify roleName. */ + interface WithRoleName { + /** + * Specifies the roleName property: The role name.. + * + * @param roleName The role name. + * @return the next definition stage. + */ + WithCreate withRoleName(String roleName); + } + + /** The stage of the RoleDefinition definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: The role definition description.. + * + * @param description The role definition description. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + + /** The stage of the RoleDefinition definition allowing to specify roleType. */ + interface WithRoleType { + /** + * Specifies the roleType property: The role type.. + * + * @param roleType The role type. + * @return the next definition stage. + */ + WithCreate withRoleType(String roleType); + } + + /** The stage of the RoleDefinition definition allowing to specify permissions. */ + interface WithPermissions { + /** + * Specifies the permissions property: Role definition permissions.. + * + * @param permissions Role definition permissions. + * @return the next definition stage. + */ + WithCreate withPermissions(List permissions); + } + + /** The stage of the RoleDefinition definition allowing to specify assignableScopes. */ + interface WithAssignableScopes { + /** + * Specifies the assignableScopes property: Role definition assignable scopes.. + * + * @param assignableScopes Role definition assignable scopes. + * @return the next definition stage. + */ + WithCreate withAssignableScopes(List assignableScopes); + } + } + + /** + * Begins update for the RoleDefinition resource. + * + * @return the stage of resource update. + */ + RoleDefinition.Update update(); + + /** The template for RoleDefinition update. */ + interface Update + extends UpdateStages.WithRoleName, + UpdateStages.WithDescription, + UpdateStages.WithRoleType, + UpdateStages.WithPermissions, + UpdateStages.WithAssignableScopes { + /** + * Executes the update request. + * + * @return the updated resource. + */ + RoleDefinition apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + RoleDefinition apply(Context context); + } + + /** The RoleDefinition update stages. */ + interface UpdateStages { + /** The stage of the RoleDefinition update allowing to specify roleName. */ + interface WithRoleName { + /** + * Specifies the roleName property: The role name.. + * + * @param roleName The role name. + * @return the next definition stage. + */ + Update withRoleName(String roleName); + } + + /** The stage of the RoleDefinition update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: The role definition description.. + * + * @param description The role definition description. + * @return the next definition stage. + */ + Update withDescription(String description); + } + + /** The stage of the RoleDefinition update allowing to specify roleType. */ + interface WithRoleType { + /** + * Specifies the roleType property: The role type.. + * + * @param roleType The role type. + * @return the next definition stage. + */ + Update withRoleType(String roleType); + } + + /** The stage of the RoleDefinition update allowing to specify permissions. */ + interface WithPermissions { + /** + * Specifies the permissions property: Role definition permissions.. + * + * @param permissions Role definition permissions. + * @return the next definition stage. + */ + Update withPermissions(List permissions); + } + + /** The stage of the RoleDefinition update allowing to specify assignableScopes. */ + interface WithAssignableScopes { + /** + * Specifies the assignableScopes property: Role definition assignable scopes.. + * + * @param assignableScopes Role definition assignable scopes. + * @return the next definition stage. + */ + Update withAssignableScopes(List assignableScopes); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + RoleDefinition refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + RoleDefinition refresh(Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleDefinitionListResult.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleDefinitionListResult.java new file mode 100644 index 000000000000..88ebe94186bf --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleDefinitionListResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleDefinitionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Role definition list operation result. */ +@Fluent +public final class RoleDefinitionListResult { + /* + * Role 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; + + /** Creates an instance of RoleDefinitionListResult class. */ + public RoleDefinitionListResult() { + } + + /** + * Get the value property: Role definition list. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Role definition list. + * + * @param value the value value to set. + * @return the RoleDefinitionListResult object itself. + */ + public RoleDefinitionListResult 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 RoleDefinitionListResult object itself. + */ + public RoleDefinitionListResult 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/RoleDefinitions.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleDefinitions.java new file mode 100644 index 000000000000..54ecc2513a01 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleDefinitions.java @@ -0,0 +1,167 @@ +// 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 RoleDefinitions. */ +public interface RoleDefinitions { + /** + * Deletes a role definition. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleDefinitionId The ID of the role definition to delete. + * @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 role definition along with {@link Response}. + */ + Response deleteByResourceGroupWithResponse(String scope, String roleDefinitionId, Context context); + + /** + * Deletes a role definition. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleDefinitionId The ID of the role definition to delete. + * @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 role definition. + */ + RoleDefinition deleteByResourceGroup(String scope, String roleDefinitionId); + + /** + * Get role definition by ID (GUID). + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleDefinitionId The ID of the role 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 role definition by ID (GUID) along with {@link Response}. + */ + Response getWithResponse(String scope, String roleDefinitionId, Context context); + + /** + * Get role definition by ID (GUID). + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param roleDefinitionId The ID of the role 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 role definition by ID (GUID). + */ + RoleDefinition get(String scope, String roleDefinitionId); + + /** + * Get all role definitions that are applicable at scope and above. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @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 all role definitions that are applicable at scope and above as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String scope); + + /** + * Get all role definitions that are applicable at scope and above. + * + * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * @param filter The filter to apply on the operation. Use atScopeAndBelow filter to search below the given scope as + * well. + * @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 all role definitions that are applicable at scope and above as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String scope, String filter, Context context); + + /** + * Gets a role definition by ID. + * + * @param roleId The fully qualified role definition ID. Use the format, + * /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for subscription + * level role definitions, or /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for tenant + * level role definitions. + * @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 a role definition by ID along with {@link Response}. + */ + Response getByIdWithResponse(String roleId, Context context); + + /** + * Gets a role definition by ID. + * + * @param roleId The fully qualified role definition ID. Use the format, + * /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for subscription + * level role definitions, or /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for tenant + * level role definitions. + * @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 a role definition by ID. + */ + RoleDefinition getById(String roleId); + + /** + * Deletes a role definition. + * + * @param id the resource ID. + * @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 role definition along with {@link Response}. + */ + RoleDefinition deleteById(String id); + + /** + * Deletes a role definition. + * + * @param id the resource ID. + * @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 role definition along with {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new RoleDefinition resource. + * + * @param name resource name. + * @return the first stage of the new RoleDefinition definition. + */ + RoleDefinition.DefinitionStages.Blank define(String name); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilitySchedule.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilitySchedule.java new file mode 100644 index 000000000000..9704db9e64e4 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilitySchedule.java @@ -0,0 +1,141 @@ +// 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.RoleEligibilityScheduleInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of RoleEligibilitySchedule. */ +public interface RoleEligibilitySchedule { + /** + * Gets the id property: The role eligibility schedule Id. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The role eligibility schedule name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The role eligibility schedule type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the scope property: The role eligibility schedule scope. + * + * @return the scope value. + */ + String scope(); + + /** + * Gets the roleDefinitionId property: The role definition ID. + * + * @return the roleDefinitionId value. + */ + String roleDefinitionId(); + + /** + * Gets the principalId property: The principal ID. + * + * @return the principalId value. + */ + String principalId(); + + /** + * Gets the principalType property: The principal type of the assigned principal ID. + * + * @return the principalType value. + */ + PrincipalType principalType(); + + /** + * Gets the roleEligibilityScheduleRequestId property: The id of roleEligibilityScheduleRequest used to create this + * roleAssignmentSchedule. + * + * @return the roleEligibilityScheduleRequestId value. + */ + String roleEligibilityScheduleRequestId(); + + /** + * Gets the memberType property: Membership type of the role eligibility schedule. + * + * @return the memberType value. + */ + MemberType memberType(); + + /** + * Gets the status property: The status of the role eligibility schedule. + * + * @return the status value. + */ + Status status(); + + /** + * Gets the startDateTime property: Start DateTime when role eligibility schedule. + * + * @return the startDateTime value. + */ + OffsetDateTime startDateTime(); + + /** + * Gets the endDateTime property: End DateTime when role eligibility schedule. + * + * @return the endDateTime value. + */ + OffsetDateTime endDateTime(); + + /** + * Gets the condition property: The conditions on the role assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @return the condition value. + */ + String condition(); + + /** + * Gets the conditionVersion property: Version of the condition. Currently accepted value is '2.0'. + * + * @return the conditionVersion value. + */ + String conditionVersion(); + + /** + * Gets the createdOn property: DateTime when role eligibility schedule was created. + * + * @return the createdOn value. + */ + OffsetDateTime createdOn(); + + /** + * Gets the updatedOn property: DateTime when role eligibility schedule was modified. + * + * @return the updatedOn value. + */ + OffsetDateTime updatedOn(); + + /** + * Gets the expandedProperties property: Additional properties of principal, scope and role definition. + * + * @return the expandedProperties value. + */ + ExpandedProperties expandedProperties(); + + /** + * Gets the inner com.azure.resourcemanager.authorization.generated.fluent.models.RoleEligibilityScheduleInner + * object. + * + * @return the inner object. + */ + RoleEligibilityScheduleInner innerModel(); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilityScheduleInstance.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilityScheduleInstance.java new file mode 100644 index 000000000000..a4b817114414 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilityScheduleInstance.java @@ -0,0 +1,133 @@ +// 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.RoleEligibilityScheduleInstanceInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of RoleEligibilityScheduleInstance. */ +public interface RoleEligibilityScheduleInstance { + /** + * Gets the id property: The role eligibility schedule instance ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The role eligibility schedule instance name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The role eligibility schedule instance type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the scope property: The role eligibility schedule scope. + * + * @return the scope value. + */ + String scope(); + + /** + * Gets the roleDefinitionId property: The role definition ID. + * + * @return the roleDefinitionId value. + */ + String roleDefinitionId(); + + /** + * Gets the principalId property: The principal ID. + * + * @return the principalId value. + */ + String principalId(); + + /** + * Gets the principalType property: The principal type of the assigned principal ID. + * + * @return the principalType value. + */ + PrincipalType principalType(); + + /** + * Gets the roleEligibilityScheduleId property: Id of the master role eligibility schedule. + * + * @return the roleEligibilityScheduleId value. + */ + String roleEligibilityScheduleId(); + + /** + * Gets the status property: The status of the role eligibility schedule instance. + * + * @return the status value. + */ + Status status(); + + /** + * Gets the startDateTime property: The startDateTime of the role eligibility schedule instance. + * + * @return the startDateTime value. + */ + OffsetDateTime startDateTime(); + + /** + * Gets the endDateTime property: The endDateTime of the role eligibility schedule instance. + * + * @return the endDateTime value. + */ + OffsetDateTime endDateTime(); + + /** + * Gets the memberType property: Membership type of the role eligibility schedule. + * + * @return the memberType value. + */ + MemberType memberType(); + + /** + * Gets the condition property: The conditions on the role assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @return the condition value. + */ + String condition(); + + /** + * Gets the conditionVersion property: Version of the condition. Currently accepted value is '2.0'. + * + * @return the conditionVersion value. + */ + String conditionVersion(); + + /** + * Gets the createdOn property: DateTime when role eligibility schedule was created. + * + * @return the createdOn value. + */ + OffsetDateTime createdOn(); + + /** + * Gets the expandedProperties property: Additional properties of principal, scope and role definition. + * + * @return the expandedProperties value. + */ + ExpandedProperties expandedProperties(); + + /** + * Gets the inner + * com.azure.resourcemanager.authorization.generated.fluent.models.RoleEligibilityScheduleInstanceInner object. + * + * @return the inner object. + */ + RoleEligibilityScheduleInstanceInner innerModel(); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilityScheduleInstanceListResult.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilityScheduleInstanceListResult.java new file mode 100644 index 000000000000..962c85faaf02 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilityScheduleInstanceListResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleEligibilityScheduleInstanceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Role eligibility schedule instance list operation result. */ +@Fluent +public final class RoleEligibilityScheduleInstanceListResult { + /* + * Role eligibility schedule 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; + + /** Creates an instance of RoleEligibilityScheduleInstanceListResult class. */ + public RoleEligibilityScheduleInstanceListResult() { + } + + /** + * Get the value property: Role eligibility schedule instance list. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Role eligibility schedule instance list. + * + * @param value the value value to set. + * @return the RoleEligibilityScheduleInstanceListResult object itself. + */ + public RoleEligibilityScheduleInstanceListResult 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 RoleEligibilityScheduleInstanceListResult object itself. + */ + public RoleEligibilityScheduleInstanceListResult 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/RoleEligibilityScheduleInstances.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilityScheduleInstances.java new file mode 100644 index 000000000000..9c40107902ef --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilityScheduleInstances.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.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 RoleEligibilityScheduleInstances. */ +public interface RoleEligibilityScheduleInstances { + /** + * Gets role eligibility schedule instances of a role eligibility schedule. + * + * @param scope The scope of the role eligibility schedule. + * @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 role eligibility schedule instances of a role eligibility schedule as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listForScope(String scope); + + /** + * Gets role eligibility schedule instances of a role eligibility schedule. + * + * @param scope The scope of the role eligibility schedule. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules + * at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or + * below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role + * eligibility schedules for the user. Use $filter=asTarget() to return all role eligibility schedules created + * for the current user. + * @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 role eligibility schedule instances of a role eligibility schedule as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listForScope(String scope, String filter, Context context); + + /** + * Gets the specified role eligibility schedule instance. + * + * @param scope The scope of the role eligibility schedules. + * @param roleEligibilityScheduleInstanceName The name (hash of schedule name + time) of the role eligibility + * schedule to get. + * @param 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 specified role eligibility schedule instance along with {@link Response}. + */ + Response getWithResponse( + String scope, String roleEligibilityScheduleInstanceName, Context context); + + /** + * Gets the specified role eligibility schedule instance. + * + * @param scope The scope of the role eligibility schedules. + * @param roleEligibilityScheduleInstanceName The name (hash of schedule name + time) of the role eligibility + * schedule to get. + * @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 specified role eligibility schedule instance. + */ + RoleEligibilityScheduleInstance get(String scope, String roleEligibilityScheduleInstanceName); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilityScheduleListResult.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilityScheduleListResult.java new file mode 100644 index 000000000000..8faef9137a3c --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilityScheduleListResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleEligibilityScheduleInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** role eligibility schedule list operation result. */ +@Fluent +public final class RoleEligibilityScheduleListResult { + /* + * role eligibility schedule list. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of RoleEligibilityScheduleListResult class. */ + public RoleEligibilityScheduleListResult() { + } + + /** + * Get the value property: role eligibility schedule list. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: role eligibility schedule list. + * + * @param value the value value to set. + * @return the RoleEligibilityScheduleListResult object itself. + */ + public RoleEligibilityScheduleListResult 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 RoleEligibilityScheduleListResult object itself. + */ + public RoleEligibilityScheduleListResult 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/RoleEligibilityScheduleRequest.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilityScheduleRequest.java new file mode 100644 index 000000000000..486565276a53 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilityScheduleRequest.java @@ -0,0 +1,407 @@ +// 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.RoleEligibilityScheduleRequestInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of RoleEligibilityScheduleRequest. */ +public interface RoleEligibilityScheduleRequest { + /** + * Gets the id property: The role eligibility schedule request ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The role eligibility schedule request name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The role eligibility schedule request type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the scope property: The role eligibility schedule request scope. + * + * @return the scope value. + */ + String scope(); + + /** + * Gets the roleDefinitionId property: The role definition ID. + * + * @return the roleDefinitionId value. + */ + String roleDefinitionId(); + + /** + * Gets the principalId property: The principal ID. + * + * @return the principalId value. + */ + String principalId(); + + /** + * Gets the principalType property: The principal type of the assigned principal ID. + * + * @return the principalType value. + */ + PrincipalType principalType(); + + /** + * Gets the requestType property: The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign + * etc. + * + * @return the requestType value. + */ + RequestType requestType(); + + /** + * Gets the status property: The status of the role eligibility schedule request. + * + * @return the status value. + */ + Status status(); + + /** + * Gets the approvalId property: The approvalId of the role eligibility schedule request. + * + * @return the approvalId value. + */ + String approvalId(); + + /** + * Gets the scheduleInfo property: Schedule info of the role eligibility schedule. + * + * @return the scheduleInfo value. + */ + RoleEligibilityScheduleRequestPropertiesScheduleInfo scheduleInfo(); + + /** + * Gets the targetRoleEligibilityScheduleId property: The resultant role eligibility schedule id or the role + * eligibility schedule id being updated. + * + * @return the targetRoleEligibilityScheduleId value. + */ + String targetRoleEligibilityScheduleId(); + + /** + * Gets the targetRoleEligibilityScheduleInstanceId property: The role eligibility schedule instance id being + * updated. + * + * @return the targetRoleEligibilityScheduleInstanceId value. + */ + String targetRoleEligibilityScheduleInstanceId(); + + /** + * Gets the justification property: Justification for the role eligibility. + * + * @return the justification value. + */ + String justification(); + + /** + * Gets the ticketInfo property: Ticket Info of the role eligibility. + * + * @return the ticketInfo value. + */ + RoleEligibilityScheduleRequestPropertiesTicketInfo ticketInfo(); + + /** + * Gets the condition property: The conditions on the role assignment. This limits the resources it can be assigned + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @return the condition value. + */ + String condition(); + + /** + * Gets the conditionVersion property: Version of the condition. Currently accepted value is '2.0'. + * + * @return the conditionVersion value. + */ + String conditionVersion(); + + /** + * Gets the createdOn property: DateTime when role eligibility schedule request was created. + * + * @return the createdOn value. + */ + OffsetDateTime createdOn(); + + /** + * Gets the requestorId property: Id of the user who created this request. + * + * @return the requestorId value. + */ + String requestorId(); + + /** + * Gets the expandedProperties property: Additional properties of principal, scope and role definition. + * + * @return the expandedProperties value. + */ + ExpandedProperties expandedProperties(); + + /** + * Gets the inner + * com.azure.resourcemanager.authorization.generated.fluent.models.RoleEligibilityScheduleRequestInner object. + * + * @return the inner object. + */ + RoleEligibilityScheduleRequestInner innerModel(); + + /** The entirety of the RoleEligibilityScheduleRequest definition. */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScope, DefinitionStages.WithCreate { + } + + /** The RoleEligibilityScheduleRequest definition stages. */ + interface DefinitionStages { + /** The first stage of the RoleEligibilityScheduleRequest definition. */ + interface Blank extends WithScope { + } + + /** The stage of the RoleEligibilityScheduleRequest definition allowing to specify parent resource. */ + interface WithScope { + /** + * Specifies scope. + * + * @param scope The scope of the role eligibility schedule request to create. The scope can be any REST + * resource instance. For example, use + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/' for a subscription, + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' + * for a resource group, and + * '/providers/Microsoft.Subscription/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. + * @return the next definition stage. + */ + WithCreate withExistingScope(String scope); + } + + /** + * The stage of the RoleEligibilityScheduleRequest 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.WithRoleDefinitionId, + DefinitionStages.WithPrincipalId, + DefinitionStages.WithRequestType, + DefinitionStages.WithScheduleInfo, + DefinitionStages.WithTargetRoleEligibilityScheduleId, + DefinitionStages.WithTargetRoleEligibilityScheduleInstanceId, + DefinitionStages.WithJustification, + DefinitionStages.WithTicketInfo, + DefinitionStages.WithCondition, + DefinitionStages.WithConditionVersion { + /** + * Executes the create request. + * + * @return the created resource. + */ + RoleEligibilityScheduleRequest create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + RoleEligibilityScheduleRequest create(Context context); + } + + /** The stage of the RoleEligibilityScheduleRequest definition allowing to specify roleDefinitionId. */ + interface WithRoleDefinitionId { + /** + * Specifies the roleDefinitionId property: The role definition ID.. + * + * @param roleDefinitionId The role definition ID. + * @return the next definition stage. + */ + WithCreate withRoleDefinitionId(String roleDefinitionId); + } + + /** The stage of the RoleEligibilityScheduleRequest definition allowing to specify principalId. */ + interface WithPrincipalId { + /** + * Specifies the principalId property: The principal ID.. + * + * @param principalId The principal ID. + * @return the next definition stage. + */ + WithCreate withPrincipalId(String principalId); + } + + /** The stage of the RoleEligibilityScheduleRequest definition allowing to specify requestType. */ + interface WithRequestType { + /** + * Specifies the requestType property: The type of the role assignment schedule request. Eg: SelfActivate, + * AdminAssign etc. + * + * @param requestType The type of the role assignment schedule request. Eg: SelfActivate, AdminAssign etc. + * @return the next definition stage. + */ + WithCreate withRequestType(RequestType requestType); + } + + /** The stage of the RoleEligibilityScheduleRequest definition allowing to specify scheduleInfo. */ + interface WithScheduleInfo { + /** + * Specifies the scheduleInfo property: Schedule info of the role eligibility schedule. + * + * @param scheduleInfo Schedule info of the role eligibility schedule. + * @return the next definition stage. + */ + WithCreate withScheduleInfo(RoleEligibilityScheduleRequestPropertiesScheduleInfo scheduleInfo); + } + + /** + * The stage of the RoleEligibilityScheduleRequest definition allowing to specify + * targetRoleEligibilityScheduleId. + */ + interface WithTargetRoleEligibilityScheduleId { + /** + * Specifies the targetRoleEligibilityScheduleId property: The resultant role eligibility schedule id or the + * role eligibility schedule id being updated. + * + * @param targetRoleEligibilityScheduleId The resultant role eligibility schedule id or the role eligibility + * schedule id being updated. + * @return the next definition stage. + */ + WithCreate withTargetRoleEligibilityScheduleId(String targetRoleEligibilityScheduleId); + } + + /** + * The stage of the RoleEligibilityScheduleRequest definition allowing to specify + * targetRoleEligibilityScheduleInstanceId. + */ + interface WithTargetRoleEligibilityScheduleInstanceId { + /** + * Specifies the targetRoleEligibilityScheduleInstanceId property: The role eligibility schedule instance id + * being updated. + * + * @param targetRoleEligibilityScheduleInstanceId The role eligibility schedule instance id being updated. + * @return the next definition stage. + */ + WithCreate withTargetRoleEligibilityScheduleInstanceId(String targetRoleEligibilityScheduleInstanceId); + } + + /** The stage of the RoleEligibilityScheduleRequest definition allowing to specify justification. */ + interface WithJustification { + /** + * Specifies the justification property: Justification for the role eligibility. + * + * @param justification Justification for the role eligibility. + * @return the next definition stage. + */ + WithCreate withJustification(String justification); + } + + /** The stage of the RoleEligibilityScheduleRequest definition allowing to specify ticketInfo. */ + interface WithTicketInfo { + /** + * Specifies the ticketInfo property: Ticket Info of the role eligibility. + * + * @param ticketInfo Ticket Info of the role eligibility. + * @return the next definition stage. + */ + WithCreate withTicketInfo(RoleEligibilityScheduleRequestPropertiesTicketInfo ticketInfo); + } + + /** The stage of the RoleEligibilityScheduleRequest definition allowing to specify condition. */ + interface WithCondition { + /** + * Specifies the condition property: The conditions on the role assignment. This limits the resources it can + * be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * + * @param condition The conditions on the role assignment. This limits the resources it can be assigned to. + * e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * StringEqualsIgnoreCase 'foo_storage_container'. + * @return the next definition stage. + */ + WithCreate withCondition(String condition); + } + + /** The stage of the RoleEligibilityScheduleRequest definition allowing to specify conditionVersion. */ + interface WithConditionVersion { + /** + * Specifies the conditionVersion property: Version of the condition. Currently accepted value is '2.0'. + * + * @param conditionVersion Version of the condition. Currently accepted value is '2.0'. + * @return the next definition stage. + */ + WithCreate withConditionVersion(String conditionVersion); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + RoleEligibilityScheduleRequest refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + RoleEligibilityScheduleRequest refresh(Context context); + + /** + * Cancels a pending role eligibility schedule request. + * + * @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 cancelWithResponse(Context context); + + /** + * Cancels a pending role eligibility schedule request. + * + * @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 cancel(); + + /** + * Validates a new role eligibility schedule request. + * + * @param parameters Parameters for the role eligibility schedule request. + * @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 role Eligibility schedule request along with {@link Response}. + */ + Response validateWithResponse( + RoleEligibilityScheduleRequestInner parameters, Context context); + + /** + * Validates a new role eligibility schedule request. + * + * @param parameters Parameters for the role eligibility schedule request. + * @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 role Eligibility schedule request. + */ + RoleEligibilityScheduleRequest validate(RoleEligibilityScheduleRequestInner parameters); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilityScheduleRequestListResult.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilityScheduleRequestListResult.java new file mode 100644 index 000000000000..cc17f6ec4993 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilityScheduleRequestListResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleEligibilityScheduleRequestInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Role eligibility schedule request list operation result. */ +@Fluent +public final class RoleEligibilityScheduleRequestListResult { + /* + * Role eligibility schedule request list. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of RoleEligibilityScheduleRequestListResult class. */ + public RoleEligibilityScheduleRequestListResult() { + } + + /** + * Get the value property: Role eligibility schedule request list. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Role eligibility schedule request list. + * + * @param value the value value to set. + * @return the RoleEligibilityScheduleRequestListResult object itself. + */ + public RoleEligibilityScheduleRequestListResult 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 RoleEligibilityScheduleRequestListResult object itself. + */ + public RoleEligibilityScheduleRequestListResult 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/RoleEligibilityScheduleRequestPropertiesScheduleInfo.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilityScheduleRequestPropertiesScheduleInfo.java new file mode 100644 index 000000000000..d37a3807ecca --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilityScheduleRequestPropertiesScheduleInfo.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Schedule info of the role eligibility schedule. */ +@Fluent +public final class RoleEligibilityScheduleRequestPropertiesScheduleInfo { + /* + * Start DateTime of the role eligibility schedule. + */ + @JsonProperty(value = "startDateTime") + private OffsetDateTime startDateTime; + + /* + * Expiration of the role eligibility schedule + */ + @JsonProperty(value = "expiration") + private RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration expiration; + + /** Creates an instance of RoleEligibilityScheduleRequestPropertiesScheduleInfo class. */ + public RoleEligibilityScheduleRequestPropertiesScheduleInfo() { + } + + /** + * Get the startDateTime property: Start DateTime of the role eligibility schedule. + * + * @return the startDateTime value. + */ + public OffsetDateTime startDateTime() { + return this.startDateTime; + } + + /** + * Set the startDateTime property: Start DateTime of the role eligibility schedule. + * + * @param startDateTime the startDateTime value to set. + * @return the RoleEligibilityScheduleRequestPropertiesScheduleInfo object itself. + */ + public RoleEligibilityScheduleRequestPropertiesScheduleInfo withStartDateTime(OffsetDateTime startDateTime) { + this.startDateTime = startDateTime; + return this; + } + + /** + * Get the expiration property: Expiration of the role eligibility schedule. + * + * @return the expiration value. + */ + public RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration expiration() { + return this.expiration; + } + + /** + * Set the expiration property: Expiration of the role eligibility schedule. + * + * @param expiration the expiration value to set. + * @return the RoleEligibilityScheduleRequestPropertiesScheduleInfo object itself. + */ + public RoleEligibilityScheduleRequestPropertiesScheduleInfo withExpiration( + RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration expiration) { + this.expiration = expiration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (expiration() != null) { + expiration().validate(); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.java new file mode 100644 index 000000000000..1af57698f107 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration.java @@ -0,0 +1,103 @@ +// 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; +import java.time.OffsetDateTime; + +/** Expiration of the role eligibility schedule. */ +@Fluent +public final class RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration { + /* + * Type of the role eligibility schedule expiration + */ + @JsonProperty(value = "type") + private Type type; + + /* + * End DateTime of the role eligibility schedule. + */ + @JsonProperty(value = "endDateTime") + private OffsetDateTime endDateTime; + + /* + * Duration of the role eligibility schedule in TimeSpan. + */ + @JsonProperty(value = "duration") + private String duration; + + /** Creates an instance of RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration class. */ + public RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration() { + } + + /** + * Get the type property: Type of the role eligibility schedule expiration. + * + * @return the type value. + */ + public Type type() { + return this.type; + } + + /** + * Set the type property: Type of the role eligibility schedule expiration. + * + * @param type the type value to set. + * @return the RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration object itself. + */ + public RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration withType(Type type) { + this.type = type; + return this; + } + + /** + * Get the endDateTime property: End DateTime of the role eligibility schedule. + * + * @return the endDateTime value. + */ + public OffsetDateTime endDateTime() { + return this.endDateTime; + } + + /** + * Set the endDateTime property: End DateTime of the role eligibility schedule. + * + * @param endDateTime the endDateTime value to set. + * @return the RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration object itself. + */ + public RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration withEndDateTime(OffsetDateTime endDateTime) { + this.endDateTime = endDateTime; + return this; + } + + /** + * Get the duration property: Duration of the role eligibility schedule in TimeSpan. + * + * @return the duration value. + */ + public String duration() { + return this.duration; + } + + /** + * Set the duration property: Duration of the role eligibility schedule in TimeSpan. + * + * @param duration the duration value to set. + * @return the RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration object itself. + */ + public RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration withDuration(String duration) { + this.duration = duration; + 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/RoleEligibilityScheduleRequestPropertiesTicketInfo.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilityScheduleRequestPropertiesTicketInfo.java new file mode 100644 index 000000000000..f2f834215637 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilityScheduleRequestPropertiesTicketInfo.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Ticket Info of the role eligibility. */ +@Fluent +public final class RoleEligibilityScheduleRequestPropertiesTicketInfo { + /* + * Ticket number for the role eligibility + */ + @JsonProperty(value = "ticketNumber") + private String ticketNumber; + + /* + * Ticket system name for the role eligibility + */ + @JsonProperty(value = "ticketSystem") + private String ticketSystem; + + /** Creates an instance of RoleEligibilityScheduleRequestPropertiesTicketInfo class. */ + public RoleEligibilityScheduleRequestPropertiesTicketInfo() { + } + + /** + * Get the ticketNumber property: Ticket number for the role eligibility. + * + * @return the ticketNumber value. + */ + public String ticketNumber() { + return this.ticketNumber; + } + + /** + * Set the ticketNumber property: Ticket number for the role eligibility. + * + * @param ticketNumber the ticketNumber value to set. + * @return the RoleEligibilityScheduleRequestPropertiesTicketInfo object itself. + */ + public RoleEligibilityScheduleRequestPropertiesTicketInfo withTicketNumber(String ticketNumber) { + this.ticketNumber = ticketNumber; + return this; + } + + /** + * Get the ticketSystem property: Ticket system name for the role eligibility. + * + * @return the ticketSystem value. + */ + public String ticketSystem() { + return this.ticketSystem; + } + + /** + * Set the ticketSystem property: Ticket system name for the role eligibility. + * + * @param ticketSystem the ticketSystem value to set. + * @return the RoleEligibilityScheduleRequestPropertiesTicketInfo object itself. + */ + public RoleEligibilityScheduleRequestPropertiesTicketInfo withTicketSystem(String ticketSystem) { + this.ticketSystem = ticketSystem; + 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/RoleEligibilityScheduleRequests.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilityScheduleRequests.java new file mode 100644 index 000000000000..d45903fefb71 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilityScheduleRequests.java @@ -0,0 +1,155 @@ +// 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.RoleEligibilityScheduleRequestInner; + +/** Resource collection API of RoleEligibilityScheduleRequests. */ +public interface RoleEligibilityScheduleRequests { + /** + * Get the specified role eligibility schedule request. + * + * @param scope The scope of the role eligibility schedule request. + * @param roleEligibilityScheduleRequestName The name (guid) of the role eligibility schedule request to get. + * @param 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 specified role eligibility schedule request along with {@link Response}. + */ + Response getWithResponse( + String scope, String roleEligibilityScheduleRequestName, Context context); + + /** + * Get the specified role eligibility schedule request. + * + * @param scope The scope of the role eligibility schedule request. + * @param roleEligibilityScheduleRequestName The name (guid) of the role eligibility schedule request to get. + * @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 specified role eligibility schedule request. + */ + RoleEligibilityScheduleRequest get(String scope, String roleEligibilityScheduleRequestName); + + /** + * Gets role eligibility schedule requests for a scope. + * + * @param scope The scope of the role eligibility schedule requests. + * @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 role eligibility schedule requests for a scope as paginated response with {@link PagedIterable}. + */ + PagedIterable listForScope(String scope); + + /** + * Gets role eligibility schedule requests for a scope. + * + * @param scope The scope of the role eligibility schedule requests. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedule + * requests at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedule + * requests at, above or below the scope for the specified principal. Use $filter=asRequestor() to return all + * role eligibility schedule requests requested by the current user. Use $filter=asTarget() to return all role + * eligibility schedule requests created for the current user. Use $filter=asApprover() to return all role + * eligibility schedule requests where the current user is an approver. + * @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 role eligibility schedule requests for a scope as paginated response with {@link PagedIterable}. + */ + PagedIterable listForScope(String scope, String filter, Context context); + + /** + * Cancels a pending role eligibility schedule request. + * + * @param scope The scope of the role eligibility request to cancel. + * @param roleEligibilityScheduleRequestName The name of the role eligibility request to cancel. + * @param 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 cancelWithResponse(String scope, String roleEligibilityScheduleRequestName, Context context); + + /** + * Cancels a pending role eligibility schedule request. + * + * @param scope The scope of the role eligibility request to cancel. + * @param roleEligibilityScheduleRequestName The name of the role eligibility request to cancel. + * @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 cancel(String scope, String roleEligibilityScheduleRequestName); + + /** + * Validates a new role eligibility schedule request. + * + * @param scope The scope of the role eligibility request to validate. + * @param roleEligibilityScheduleRequestName The name of the role eligibility request to validate. + * @param parameters Parameters for the role eligibility schedule request. + * @param 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 role Eligibility schedule request along with {@link Response}. + */ + Response validateWithResponse( + String scope, + String roleEligibilityScheduleRequestName, + RoleEligibilityScheduleRequestInner parameters, + Context context); + + /** + * Validates a new role eligibility schedule request. + * + * @param scope The scope of the role eligibility request to validate. + * @param roleEligibilityScheduleRequestName The name of the role eligibility request to validate. + * @param parameters Parameters for the role eligibility schedule request. + * @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 role Eligibility schedule request. + */ + RoleEligibilityScheduleRequest validate( + String scope, String roleEligibilityScheduleRequestName, RoleEligibilityScheduleRequestInner parameters); + + /** + * Get the specified role eligibility schedule request. + * + * @param id the resource ID. + * @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 specified role eligibility schedule request along with {@link Response}. + */ + RoleEligibilityScheduleRequest getById(String id); + + /** + * Get the specified role eligibility schedule request. + * + * @param id the resource ID. + * @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 specified role eligibility schedule request along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new RoleEligibilityScheduleRequest resource. + * + * @param name resource name. + * @return the first stage of the new RoleEligibilityScheduleRequest definition. + */ + RoleEligibilityScheduleRequest.DefinitionStages.Blank define(String name); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilitySchedules.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilitySchedules.java new file mode 100644 index 000000000000..230e799e0219 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleEligibilitySchedules.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.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of RoleEligibilitySchedules. */ +public interface RoleEligibilitySchedules { + /** + * Get the specified role eligibility schedule for a resource scope. + * + * @param scope The scope of the role eligibility schedule. + * @param roleEligibilityScheduleName The name (guid) of the role eligibility schedule to get. + * @param 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 specified role eligibility schedule for a resource scope along with {@link Response}. + */ + Response getWithResponse( + String scope, String roleEligibilityScheduleName, Context context); + + /** + * Get the specified role eligibility schedule for a resource scope. + * + * @param scope The scope of the role eligibility schedule. + * @param roleEligibilityScheduleName The name (guid) of the role eligibility schedule to get. + * @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 specified role eligibility schedule for a resource scope. + */ + RoleEligibilitySchedule get(String scope, String roleEligibilityScheduleName); + + /** + * Gets role eligibility schedules for a resource scope. + * + * @param scope The scope of the role eligibility schedules. + * @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 role eligibility schedules for a resource scope as paginated response with {@link PagedIterable}. + */ + PagedIterable listForScope(String scope); + + /** + * Gets role eligibility schedules for a resource scope. + * + * @param scope The scope of the role eligibility schedules. + * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role eligibility + * schedules at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedules at, + * above or below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role + * eligibility schedules for the user. Use $filter=asTarget() to return all role eligibility schedules created + * for the current user. + * @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 role eligibility schedules for a resource scope as paginated response with {@link PagedIterable}. + */ + PagedIterable listForScope(String scope, String filter, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicies.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicies.java new file mode 100644 index 000000000000..f3c266323d99 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicies.java @@ -0,0 +1,113 @@ +// 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.RoleManagementPolicyInner; + +/** Resource collection API of RoleManagementPolicies. */ +public interface RoleManagementPolicies { + /** + * Get the specified role management policy for a resource scope. + * + * @param scope The scope of the role management policy. + * @param roleManagementPolicyName The name (guid) of the role management policy to get. + * @param 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 specified role management policy for a resource scope along with {@link Response}. + */ + Response getWithResponse(String scope, String roleManagementPolicyName, Context context); + + /** + * Get the specified role management policy for a resource scope. + * + * @param scope The scope of the role management policy. + * @param roleManagementPolicyName The name (guid) of the role management policy to get. + * @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 specified role management policy for a resource scope. + */ + RoleManagementPolicy get(String scope, String roleManagementPolicyName); + + /** + * Update a role management policy. + * + * @param scope The scope of the role management policy to upsert. + * @param roleManagementPolicyName The name (guid) of the role management policy to upsert. + * @param parameters Parameters for the role management policy. + * @param 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 role management policy along with {@link Response}. + */ + Response updateWithResponse( + String scope, String roleManagementPolicyName, RoleManagementPolicyInner parameters, Context context); + + /** + * Update a role management policy. + * + * @param scope The scope of the role management policy to upsert. + * @param roleManagementPolicyName The name (guid) of the role management policy to upsert. + * @param parameters Parameters for the role management policy. + * @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 role management policy. + */ + RoleManagementPolicy update(String scope, String roleManagementPolicyName, RoleManagementPolicyInner parameters); + + /** + * Delete a role management policy. + * + * @param scope The scope of the role management policy to upsert. + * @param roleManagementPolicyName The name (guid) of the role management policy to upsert. + * @param 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 deleteByResourceGroupWithResponse(String scope, String roleManagementPolicyName, Context context); + + /** + * Delete a role management policy. + * + * @param scope The scope of the role management policy to upsert. + * @param roleManagementPolicyName The name (guid) of the role management policy to upsert. + * @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 deleteByResourceGroup(String scope, String roleManagementPolicyName); + + /** + * Gets role management policies for a resource scope. + * + * @param scope The scope of the role management policy. + * @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 role management policies for a resource scope as paginated response with {@link PagedIterable}. + */ + PagedIterable listForScope(String scope); + + /** + * Gets role management policies for a resource scope. + * + * @param scope The scope of the role management policy. + * @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 role management policies for a resource scope as paginated response with {@link PagedIterable}. + */ + PagedIterable listForScope(String scope, Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicy.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicy.java new file mode 100644 index 000000000000..73df63fd104d --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicy.java @@ -0,0 +1,103 @@ +// 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.RoleManagementPolicyInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of RoleManagementPolicy. */ +public interface RoleManagementPolicy { + /** + * Gets the id property: The role management policy Id. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The role management policy name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The role management policy type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the scope property: The role management policy scope. + * + * @return the scope value. + */ + String scope(); + + /** + * Gets the displayName property: The role management policy display name. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the description property: The role management policy description. + * + * @return the description value. + */ + String description(); + + /** + * Gets the isOrganizationDefault property: The role management policy is default policy. + * + * @return the isOrganizationDefault value. + */ + Boolean isOrganizationDefault(); + + /** + * Gets the lastModifiedBy property: The name of the entity last modified it. + * + * @return the lastModifiedBy value. + */ + Principal lastModifiedBy(); + + /** + * Gets the lastModifiedDateTime property: The last modified date time. + * + * @return the lastModifiedDateTime value. + */ + OffsetDateTime lastModifiedDateTime(); + + /** + * Gets the rules property: The rule applied to the policy. + * + * @return the rules value. + */ + List rules(); + + /** + * Gets the effectiveRules property: The readonly computed rule applied to the policy. + * + * @return the effectiveRules value. + */ + List effectiveRules(); + + /** + * Gets the policyProperties property: Additional properties of scope. + * + * @return the policyProperties value. + */ + PolicyProperties policyProperties(); + + /** + * Gets the inner com.azure.resourcemanager.authorization.generated.fluent.models.RoleManagementPolicyInner object. + * + * @return the inner object. + */ + RoleManagementPolicyInner innerModel(); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyApprovalRule.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyApprovalRule.java new file mode 100644 index 000000000000..b871a38fb471 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyApprovalRule.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The role management policy approval rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") +@JsonTypeName("RoleManagementPolicyApprovalRule") +@Fluent +public final class RoleManagementPolicyApprovalRule extends RoleManagementPolicyRule { + /* + * The approval setting + */ + @JsonProperty(value = "setting") + private ApprovalSettings setting; + + /** Creates an instance of RoleManagementPolicyApprovalRule class. */ + public RoleManagementPolicyApprovalRule() { + } + + /** + * Get the setting property: The approval setting. + * + * @return the setting value. + */ + public ApprovalSettings setting() { + return this.setting; + } + + /** + * Set the setting property: The approval setting. + * + * @param setting the setting value to set. + * @return the RoleManagementPolicyApprovalRule object itself. + */ + public RoleManagementPolicyApprovalRule withSetting(ApprovalSettings setting) { + this.setting = setting; + return this; + } + + /** {@inheritDoc} */ + @Override + public RoleManagementPolicyApprovalRule withId(String id) { + super.withId(id); + return this; + } + + /** {@inheritDoc} */ + @Override + public RoleManagementPolicyApprovalRule withTarget(RoleManagementPolicyRuleTarget target) { + super.withTarget(target); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (setting() != null) { + setting().validate(); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyAssignment.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyAssignment.java new file mode 100644 index 000000000000..f45304d2ee96 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyAssignment.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.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleManagementPolicyAssignmentInner; + +/** An immutable client-side representation of RoleManagementPolicyAssignment. */ +public interface RoleManagementPolicyAssignment { + /** + * Gets the id property: The role management policy Id. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The role management policy name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The role management policy type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the scope property: The role management policy scope. + * + * @return the scope value. + */ + String scope(); + + /** + * Gets the roleDefinitionId property: The role definition of management policy assignment. + * + * @return the roleDefinitionId value. + */ + String roleDefinitionId(); + + /** + * Gets the policyId property: The policy id role management policy assignment. + * + * @return the policyId value. + */ + String policyId(); + + /** + * Gets the policyAssignmentProperties property: Additional properties of scope, role definition and policy. + * + * @return the policyAssignmentProperties value. + */ + PolicyAssignmentProperties policyAssignmentProperties(); + + /** + * Gets the inner + * com.azure.resourcemanager.authorization.generated.fluent.models.RoleManagementPolicyAssignmentInner object. + * + * @return the inner object. + */ + RoleManagementPolicyAssignmentInner innerModel(); + + /** The entirety of the RoleManagementPolicyAssignment definition. */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScopeStage, DefinitionStages.WithCreate { + } + + /** The RoleManagementPolicyAssignment definition stages. */ + interface DefinitionStages { + /** The first stage of the RoleManagementPolicyAssignment definition. */ + interface Blank extends WithScopeStage { + } + + /** The stage of the RoleManagementPolicyAssignment definition allowing to specify parent resource. */ + interface WithScopeStage { + /** + * Specifies scope. + * + * @param scope The scope of the role management policy assignment to upsert. + * @return the next definition stage. + */ + WithCreate withExistingScope(String scope); + } + + /** + * The stage of the RoleManagementPolicyAssignment 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.WithScope, DefinitionStages.WithRoleDefinitionId, DefinitionStages.WithPolicyId { + /** + * Executes the create request. + * + * @return the created resource. + */ + RoleManagementPolicyAssignment create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + RoleManagementPolicyAssignment create(Context context); + } + + /** The stage of the RoleManagementPolicyAssignment definition allowing to specify scope. */ + interface WithScope { + /** + * Specifies the scope property: The role management policy scope.. + * + * @param scope The role management policy scope. + * @return the next definition stage. + */ + WithCreate withScope(String scope); + } + + /** The stage of the RoleManagementPolicyAssignment definition allowing to specify roleDefinitionId. */ + interface WithRoleDefinitionId { + /** + * Specifies the roleDefinitionId property: The role definition of management policy assignment.. + * + * @param roleDefinitionId The role definition of management policy assignment. + * @return the next definition stage. + */ + WithCreate withRoleDefinitionId(String roleDefinitionId); + } + + /** The stage of the RoleManagementPolicyAssignment definition allowing to specify policyId. */ + interface WithPolicyId { + /** + * Specifies the policyId property: The policy id role management policy assignment.. + * + * @param policyId The policy id role management policy assignment. + * @return the next definition stage. + */ + WithCreate withPolicyId(String policyId); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + RoleManagementPolicyAssignment refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + RoleManagementPolicyAssignment refresh(Context context); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyAssignmentListResult.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyAssignmentListResult.java new file mode 100644 index 000000000000..e92be3cd2d39 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyAssignmentListResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleManagementPolicyAssignmentInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Role management policy assignment list operation result. */ +@Fluent +public final class RoleManagementPolicyAssignmentListResult { + /* + * Role management policy assignment list. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of RoleManagementPolicyAssignmentListResult class. */ + public RoleManagementPolicyAssignmentListResult() { + } + + /** + * Get the value property: Role management policy assignment list. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Role management policy assignment list. + * + * @param value the value value to set. + * @return the RoleManagementPolicyAssignmentListResult object itself. + */ + public RoleManagementPolicyAssignmentListResult 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 RoleManagementPolicyAssignmentListResult object itself. + */ + public RoleManagementPolicyAssignmentListResult 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/RoleManagementPolicyAssignments.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyAssignments.java new file mode 100644 index 000000000000..fe5f1a256405 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyAssignments.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; + +/** Resource collection API of RoleManagementPolicyAssignments. */ +public interface RoleManagementPolicyAssignments { + /** + * Get the specified role management policy assignment for a resource scope. + * + * @param scope The scope of the role management policy. + * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy assignment to + * get. + * @param 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 specified role management policy assignment for a resource scope along with {@link Response}. + */ + Response getWithResponse( + String scope, String roleManagementPolicyAssignmentName, Context context); + + /** + * Get the specified role management policy assignment for a resource scope. + * + * @param scope The scope of the role management policy. + * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy assignment to + * get. + * @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 specified role management policy assignment for a resource scope. + */ + RoleManagementPolicyAssignment get(String scope, String roleManagementPolicyAssignmentName); + + /** + * Delete a role management policy assignment. + * + * @param scope The scope of the role management policy assignment to delete. + * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy assignment to + * delete. + * @param 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 deleteByResourceGroupWithResponse( + String scope, String roleManagementPolicyAssignmentName, Context context); + + /** + * Delete a role management policy assignment. + * + * @param scope The scope of the role management policy assignment to delete. + * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy assignment to + * delete. + * @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 deleteByResourceGroup(String scope, String roleManagementPolicyAssignmentName); + + /** + * Gets role management assignment policies for a resource scope. + * + * @param scope The scope of the role management policy. + * @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 role management assignment policies for a resource scope as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listForScope(String scope); + + /** + * Gets role management assignment policies for a resource scope. + * + * @param scope The scope of the role management policy. + * @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 role management assignment policies for a resource scope as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listForScope(String scope, Context context); + + /** + * Get the specified role management policy assignment for a resource scope. + * + * @param id the resource ID. + * @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 specified role management policy assignment for a resource scope along with {@link Response}. + */ + RoleManagementPolicyAssignment getById(String id); + + /** + * Get the specified role management policy assignment for a resource scope. + * + * @param id the resource ID. + * @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 specified role management policy assignment for a resource scope along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a role management policy assignment. + * + * @param id the resource ID. + * @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 id); + + /** + * Delete a role management policy assignment. + * + * @param id the resource ID. + * @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 id, Context context); + + /** + * Begins definition for a new RoleManagementPolicyAssignment resource. + * + * @param name resource name. + * @return the first stage of the new RoleManagementPolicyAssignment definition. + */ + RoleManagementPolicyAssignment.DefinitionStages.Blank define(String name); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyAuthenticationContextRule.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyAuthenticationContextRule.java new file mode 100644 index 000000000000..a232d015dfeb --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyAuthenticationContextRule.java @@ -0,0 +1,96 @@ +// 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; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The role management policy authentication context rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") +@JsonTypeName("RoleManagementPolicyAuthenticationContextRule") +@Fluent +public final class RoleManagementPolicyAuthenticationContextRule extends RoleManagementPolicyRule { + /* + * The value indicating if rule is enabled. + */ + @JsonProperty(value = "isEnabled") + private Boolean isEnabled; + + /* + * The claim value. + */ + @JsonProperty(value = "claimValue") + private String claimValue; + + /** Creates an instance of RoleManagementPolicyAuthenticationContextRule class. */ + public RoleManagementPolicyAuthenticationContextRule() { + } + + /** + * Get the isEnabled property: The value indicating if rule is enabled. + * + * @return the isEnabled value. + */ + public Boolean isEnabled() { + return this.isEnabled; + } + + /** + * Set the isEnabled property: The value indicating if rule is enabled. + * + * @param isEnabled the isEnabled value to set. + * @return the RoleManagementPolicyAuthenticationContextRule object itself. + */ + public RoleManagementPolicyAuthenticationContextRule withIsEnabled(Boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + /** + * Get the claimValue property: The claim value. + * + * @return the claimValue value. + */ + public String claimValue() { + return this.claimValue; + } + + /** + * Set the claimValue property: The claim value. + * + * @param claimValue the claimValue value to set. + * @return the RoleManagementPolicyAuthenticationContextRule object itself. + */ + public RoleManagementPolicyAuthenticationContextRule withClaimValue(String claimValue) { + this.claimValue = claimValue; + return this; + } + + /** {@inheritDoc} */ + @Override + public RoleManagementPolicyAuthenticationContextRule withId(String id) { + super.withId(id); + return this; + } + + /** {@inheritDoc} */ + @Override + public RoleManagementPolicyAuthenticationContextRule withTarget(RoleManagementPolicyRuleTarget target) { + super.withTarget(target); + return this; + } + + /** + * 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/RoleManagementPolicyEnablementRule.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyEnablementRule.java new file mode 100644 index 000000000000..511d43981ad6 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyEnablementRule.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.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** The role management policy enablement rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") +@JsonTypeName("RoleManagementPolicyEnablementRule") +@Fluent +public final class RoleManagementPolicyEnablementRule extends RoleManagementPolicyRule { + /* + * The list of enabled rules. + */ + @JsonProperty(value = "enabledRules") + private List enabledRules; + + /** Creates an instance of RoleManagementPolicyEnablementRule class. */ + public RoleManagementPolicyEnablementRule() { + } + + /** + * Get the enabledRules property: The list of enabled rules. + * + * @return the enabledRules value. + */ + public List enabledRules() { + return this.enabledRules; + } + + /** + * Set the enabledRules property: The list of enabled rules. + * + * @param enabledRules the enabledRules value to set. + * @return the RoleManagementPolicyEnablementRule object itself. + */ + public RoleManagementPolicyEnablementRule withEnabledRules(List enabledRules) { + this.enabledRules = enabledRules; + return this; + } + + /** {@inheritDoc} */ + @Override + public RoleManagementPolicyEnablementRule withId(String id) { + super.withId(id); + return this; + } + + /** {@inheritDoc} */ + @Override + public RoleManagementPolicyEnablementRule withTarget(RoleManagementPolicyRuleTarget target) { + super.withTarget(target); + return this; + } + + /** + * 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/RoleManagementPolicyExpirationRule.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyExpirationRule.java new file mode 100644 index 000000000000..088f08a13815 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyExpirationRule.java @@ -0,0 +1,96 @@ +// 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; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The role management policy expiration rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") +@JsonTypeName("RoleManagementPolicyExpirationRule") +@Fluent +public final class RoleManagementPolicyExpirationRule extends RoleManagementPolicyRule { + /* + * The value indicating whether expiration is required. + */ + @JsonProperty(value = "isExpirationRequired") + private Boolean isExpirationRequired; + + /* + * The maximum duration of expiration in timespan. + */ + @JsonProperty(value = "maximumDuration") + private String maximumDuration; + + /** Creates an instance of RoleManagementPolicyExpirationRule class. */ + public RoleManagementPolicyExpirationRule() { + } + + /** + * Get the isExpirationRequired property: The value indicating whether expiration is required. + * + * @return the isExpirationRequired value. + */ + public Boolean isExpirationRequired() { + return this.isExpirationRequired; + } + + /** + * Set the isExpirationRequired property: The value indicating whether expiration is required. + * + * @param isExpirationRequired the isExpirationRequired value to set. + * @return the RoleManagementPolicyExpirationRule object itself. + */ + public RoleManagementPolicyExpirationRule withIsExpirationRequired(Boolean isExpirationRequired) { + this.isExpirationRequired = isExpirationRequired; + return this; + } + + /** + * Get the maximumDuration property: The maximum duration of expiration in timespan. + * + * @return the maximumDuration value. + */ + public String maximumDuration() { + return this.maximumDuration; + } + + /** + * Set the maximumDuration property: The maximum duration of expiration in timespan. + * + * @param maximumDuration the maximumDuration value to set. + * @return the RoleManagementPolicyExpirationRule object itself. + */ + public RoleManagementPolicyExpirationRule withMaximumDuration(String maximumDuration) { + this.maximumDuration = maximumDuration; + return this; + } + + /** {@inheritDoc} */ + @Override + public RoleManagementPolicyExpirationRule withId(String id) { + super.withId(id); + return this; + } + + /** {@inheritDoc} */ + @Override + public RoleManagementPolicyExpirationRule withTarget(RoleManagementPolicyRuleTarget target) { + super.withTarget(target); + return this; + } + + /** + * 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/RoleManagementPolicyListResult.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyListResult.java new file mode 100644 index 000000000000..d681fbd77208 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyListResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleManagementPolicyInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Role management policy list operation result. */ +@Fluent +public final class RoleManagementPolicyListResult { + /* + * Role management policy list. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of RoleManagementPolicyListResult class. */ + public RoleManagementPolicyListResult() { + } + + /** + * Get the value property: Role management policy list. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Role management policy list. + * + * @param value the value value to set. + * @return the RoleManagementPolicyListResult object itself. + */ + public RoleManagementPolicyListResult 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 RoleManagementPolicyListResult object itself. + */ + public RoleManagementPolicyListResult 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/RoleManagementPolicyNotificationRule.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyNotificationRule.java new file mode 100644 index 000000000000..e3b7485e8ad3 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyNotificationRule.java @@ -0,0 +1,177 @@ +// 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; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** The role management policy notification rule. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") +@JsonTypeName("RoleManagementPolicyNotificationRule") +@Fluent +public final class RoleManagementPolicyNotificationRule extends RoleManagementPolicyRule { + /* + * The type of notification. + */ + @JsonProperty(value = "notificationType") + private NotificationDeliveryMechanism notificationType; + + /* + * The notification level. + */ + @JsonProperty(value = "notificationLevel") + private NotificationLevel notificationLevel; + + /* + * The recipient type. + */ + @JsonProperty(value = "recipientType") + private RecipientType recipientType; + + /* + * The list of notification recipients. + */ + @JsonProperty(value = "notificationRecipients") + private List notificationRecipients; + + /* + * Determines if the notification will be sent to the recipient type specified in the policy rule. + */ + @JsonProperty(value = "isDefaultRecipientsEnabled") + private Boolean isDefaultRecipientsEnabled; + + /** Creates an instance of RoleManagementPolicyNotificationRule class. */ + public RoleManagementPolicyNotificationRule() { + } + + /** + * Get the notificationType property: The type of notification. + * + * @return the notificationType value. + */ + public NotificationDeliveryMechanism notificationType() { + return this.notificationType; + } + + /** + * Set the notificationType property: The type of notification. + * + * @param notificationType the notificationType value to set. + * @return the RoleManagementPolicyNotificationRule object itself. + */ + public RoleManagementPolicyNotificationRule withNotificationType(NotificationDeliveryMechanism notificationType) { + this.notificationType = notificationType; + return this; + } + + /** + * Get the notificationLevel property: The notification level. + * + * @return the notificationLevel value. + */ + public NotificationLevel notificationLevel() { + return this.notificationLevel; + } + + /** + * Set the notificationLevel property: The notification level. + * + * @param notificationLevel the notificationLevel value to set. + * @return the RoleManagementPolicyNotificationRule object itself. + */ + public RoleManagementPolicyNotificationRule withNotificationLevel(NotificationLevel notificationLevel) { + this.notificationLevel = notificationLevel; + return this; + } + + /** + * Get the recipientType property: The recipient type. + * + * @return the recipientType value. + */ + public RecipientType recipientType() { + return this.recipientType; + } + + /** + * Set the recipientType property: The recipient type. + * + * @param recipientType the recipientType value to set. + * @return the RoleManagementPolicyNotificationRule object itself. + */ + public RoleManagementPolicyNotificationRule withRecipientType(RecipientType recipientType) { + this.recipientType = recipientType; + return this; + } + + /** + * Get the notificationRecipients property: The list of notification recipients. + * + * @return the notificationRecipients value. + */ + public List notificationRecipients() { + return this.notificationRecipients; + } + + /** + * Set the notificationRecipients property: The list of notification recipients. + * + * @param notificationRecipients the notificationRecipients value to set. + * @return the RoleManagementPolicyNotificationRule object itself. + */ + public RoleManagementPolicyNotificationRule withNotificationRecipients(List notificationRecipients) { + this.notificationRecipients = notificationRecipients; + return this; + } + + /** + * Get the isDefaultRecipientsEnabled property: Determines if the notification will be sent to the recipient type + * specified in the policy rule. + * + * @return the isDefaultRecipientsEnabled value. + */ + public Boolean isDefaultRecipientsEnabled() { + return this.isDefaultRecipientsEnabled; + } + + /** + * Set the isDefaultRecipientsEnabled property: Determines if the notification will be sent to the recipient type + * specified in the policy rule. + * + * @param isDefaultRecipientsEnabled the isDefaultRecipientsEnabled value to set. + * @return the RoleManagementPolicyNotificationRule object itself. + */ + public RoleManagementPolicyNotificationRule withIsDefaultRecipientsEnabled(Boolean isDefaultRecipientsEnabled) { + this.isDefaultRecipientsEnabled = isDefaultRecipientsEnabled; + return this; + } + + /** {@inheritDoc} */ + @Override + public RoleManagementPolicyNotificationRule withId(String id) { + super.withId(id); + return this; + } + + /** {@inheritDoc} */ + @Override + public RoleManagementPolicyNotificationRule withTarget(RoleManagementPolicyRuleTarget target) { + super.withTarget(target); + return this; + } + + /** + * 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/RoleManagementPolicyRule.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyRule.java new file mode 100644 index 000000000000..4332f7309940 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyRule.java @@ -0,0 +1,99 @@ +// 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; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The role management policy rule. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "ruleType", + defaultImpl = RoleManagementPolicyRule.class) +@JsonTypeName("RoleManagementPolicyRule") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "RoleManagementPolicyApprovalRule", value = RoleManagementPolicyApprovalRule.class), + @JsonSubTypes.Type( + name = "RoleManagementPolicyAuthenticationContextRule", + value = RoleManagementPolicyAuthenticationContextRule.class), + @JsonSubTypes.Type(name = "RoleManagementPolicyEnablementRule", value = RoleManagementPolicyEnablementRule.class), + @JsonSubTypes.Type(name = "RoleManagementPolicyExpirationRule", value = RoleManagementPolicyExpirationRule.class), + @JsonSubTypes.Type( + name = "RoleManagementPolicyNotificationRule", + value = RoleManagementPolicyNotificationRule.class) +}) +@Fluent +public class RoleManagementPolicyRule { + /* + * The id of the rule. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The target of the current rule. + */ + @JsonProperty(value = "target") + private RoleManagementPolicyRuleTarget target; + + /** Creates an instance of RoleManagementPolicyRule class. */ + public RoleManagementPolicyRule() { + } + + /** + * Get the id property: The id of the rule. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The id of the rule. + * + * @param id the id value to set. + * @return the RoleManagementPolicyRule object itself. + */ + public RoleManagementPolicyRule withId(String id) { + this.id = id; + return this; + } + + /** + * Get the target property: The target of the current rule. + * + * @return the target value. + */ + public RoleManagementPolicyRuleTarget target() { + return this.target; + } + + /** + * Set the target property: The target of the current rule. + * + * @param target the target value to set. + * @return the RoleManagementPolicyRule object itself. + */ + public RoleManagementPolicyRule withTarget(RoleManagementPolicyRuleTarget target) { + this.target = target; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (target() != null) { + target().validate(); + } + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyRuleTarget.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyRuleTarget.java new file mode 100644 index 000000000000..340674f97775 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyRuleTarget.java @@ -0,0 +1,181 @@ +// 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; +import java.util.List; + +/** The role management policy rule target. */ +@Fluent +public final class RoleManagementPolicyRuleTarget { + /* + * The caller of the setting. + */ + @JsonProperty(value = "caller") + private String caller; + + /* + * The type of operation. + */ + @JsonProperty(value = "operations") + private List operations; + + /* + * The assignment level to which rule is applied. + */ + @JsonProperty(value = "level") + private String level; + + /* + * The list of target objects. + */ + @JsonProperty(value = "targetObjects") + private List targetObjects; + + /* + * The list of inheritable settings. + */ + @JsonProperty(value = "inheritableSettings") + private List inheritableSettings; + + /* + * The list of enforced settings. + */ + @JsonProperty(value = "enforcedSettings") + private List enforcedSettings; + + /** Creates an instance of RoleManagementPolicyRuleTarget class. */ + public RoleManagementPolicyRuleTarget() { + } + + /** + * Get the caller property: The caller of the setting. + * + * @return the caller value. + */ + public String caller() { + return this.caller; + } + + /** + * Set the caller property: The caller of the setting. + * + * @param caller the caller value to set. + * @return the RoleManagementPolicyRuleTarget object itself. + */ + public RoleManagementPolicyRuleTarget withCaller(String caller) { + this.caller = caller; + return this; + } + + /** + * Get the operations property: The type of operation. + * + * @return the operations value. + */ + public List operations() { + return this.operations; + } + + /** + * Set the operations property: The type of operation. + * + * @param operations the operations value to set. + * @return the RoleManagementPolicyRuleTarget object itself. + */ + public RoleManagementPolicyRuleTarget withOperations(List operations) { + this.operations = operations; + return this; + } + + /** + * Get the level property: The assignment level to which rule is applied. + * + * @return the level value. + */ + public String level() { + return this.level; + } + + /** + * Set the level property: The assignment level to which rule is applied. + * + * @param level the level value to set. + * @return the RoleManagementPolicyRuleTarget object itself. + */ + public RoleManagementPolicyRuleTarget withLevel(String level) { + this.level = level; + return this; + } + + /** + * Get the targetObjects property: The list of target objects. + * + * @return the targetObjects value. + */ + public List targetObjects() { + return this.targetObjects; + } + + /** + * Set the targetObjects property: The list of target objects. + * + * @param targetObjects the targetObjects value to set. + * @return the RoleManagementPolicyRuleTarget object itself. + */ + public RoleManagementPolicyRuleTarget withTargetObjects(List targetObjects) { + this.targetObjects = targetObjects; + return this; + } + + /** + * Get the inheritableSettings property: The list of inheritable settings. + * + * @return the inheritableSettings value. + */ + public List inheritableSettings() { + return this.inheritableSettings; + } + + /** + * Set the inheritableSettings property: The list of inheritable settings. + * + * @param inheritableSettings the inheritableSettings value to set. + * @return the RoleManagementPolicyRuleTarget object itself. + */ + public RoleManagementPolicyRuleTarget withInheritableSettings(List inheritableSettings) { + this.inheritableSettings = inheritableSettings; + return this; + } + + /** + * Get the enforcedSettings property: The list of enforced settings. + * + * @return the enforcedSettings value. + */ + public List enforcedSettings() { + return this.enforcedSettings; + } + + /** + * Set the enforcedSettings property: The list of enforced settings. + * + * @param enforcedSettings the enforcedSettings value to set. + * @return the RoleManagementPolicyRuleTarget object itself. + */ + public RoleManagementPolicyRuleTarget withEnforcedSettings(List enforcedSettings) { + this.enforcedSettings = enforcedSettings; + 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/RoleManagementPolicyRuleType.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyRuleType.java new file mode 100644 index 000000000000..68b512259e71 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/RoleManagementPolicyRuleType.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of rule. */ +public final class RoleManagementPolicyRuleType extends ExpandableStringEnum { + /** Static value RoleManagementPolicyApprovalRule for RoleManagementPolicyRuleType. */ + public static final RoleManagementPolicyRuleType ROLE_MANAGEMENT_POLICY_APPROVAL_RULE = + fromString("RoleManagementPolicyApprovalRule"); + + /** Static value RoleManagementPolicyAuthenticationContextRule for RoleManagementPolicyRuleType. */ + public static final RoleManagementPolicyRuleType ROLE_MANAGEMENT_POLICY_AUTHENTICATION_CONTEXT_RULE = + fromString("RoleManagementPolicyAuthenticationContextRule"); + + /** Static value RoleManagementPolicyEnablementRule for RoleManagementPolicyRuleType. */ + public static final RoleManagementPolicyRuleType ROLE_MANAGEMENT_POLICY_ENABLEMENT_RULE = + fromString("RoleManagementPolicyEnablementRule"); + + /** Static value RoleManagementPolicyExpirationRule for RoleManagementPolicyRuleType. */ + public static final RoleManagementPolicyRuleType ROLE_MANAGEMENT_POLICY_EXPIRATION_RULE = + fromString("RoleManagementPolicyExpirationRule"); + + /** Static value RoleManagementPolicyNotificationRule for RoleManagementPolicyRuleType. */ + public static final RoleManagementPolicyRuleType ROLE_MANAGEMENT_POLICY_NOTIFICATION_RULE = + fromString("RoleManagementPolicyNotificationRule"); + + /** + * Creates a new instance of RoleManagementPolicyRuleType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RoleManagementPolicyRuleType() { + } + + /** + * Creates or finds a RoleManagementPolicyRuleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RoleManagementPolicyRuleType. + */ + @JsonCreator + public static RoleManagementPolicyRuleType fromString(String name) { + return fromString(name, RoleManagementPolicyRuleType.class); + } + + /** + * Gets known RoleManagementPolicyRuleType values. + * + * @return known RoleManagementPolicyRuleType values. + */ + public static Collection values() { + return values(RoleManagementPolicyRuleType.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 000000000000..adebb6e9feed --- /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. + * @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. + * @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 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); + + /** + * 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); +} 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 000000000000..07f80ad70c89 --- /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. + * @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); + + /** + * 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); +} 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 000000000000..e9c977429896 --- /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 000000000000..d15fcc0d99df --- /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. + * @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); + + /** + * 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); + + /** + * 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); + + /** + * 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); +} 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 000000000000..5bf20fec828c --- /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. + * @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); + + /** + * 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); +} 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 000000000000..0df5cb177a53 --- /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 000000000000..60dce76a0fef --- /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 000000000000..c81caa2f8cb4 --- /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. + * @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 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 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 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 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 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 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 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 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); + + /** + * 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); +} 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 000000000000..b7a2a02b86db --- /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. + * @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); + + /** + * 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); + + /** + * 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); + + /** + * 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); +} 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 000000000000..45e051f58265 --- /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. + * @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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/SeverityLevel.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/SeverityLevel.java new file mode 100644 index 000000000000..2e12e7d44c55 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/SeverityLevel.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Severity level of the alert. */ +public final class SeverityLevel extends ExpandableStringEnum { + /** Static value Low for SeverityLevel. */ + public static final SeverityLevel LOW = fromString("Low"); + + /** Static value Medium for SeverityLevel. */ + public static final SeverityLevel MEDIUM = fromString("Medium"); + + /** Static value High for SeverityLevel. */ + public static final SeverityLevel HIGH = fromString("High"); + + /** + * Creates a new instance of SeverityLevel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SeverityLevel() { + } + + /** + * Creates or finds a SeverityLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding SeverityLevel. + */ + @JsonCreator + public static SeverityLevel fromString(String name) { + return fromString(name, SeverityLevel.class); + } + + /** + * Gets known SeverityLevel values. + * + * @return known SeverityLevel values. + */ + public static Collection values() { + return values(SeverityLevel.class); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/Status.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/Status.java new file mode 100644 index 000000000000..a4a9e5b8e216 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/Status.java @@ -0,0 +1,107 @@ +// 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 status of the role assignment schedule. */ +public final class Status extends ExpandableStringEnum { + /** Static value Accepted for Status. */ + public static final Status ACCEPTED = fromString("Accepted"); + + /** Static value PendingEvaluation for Status. */ + public static final Status PENDING_EVALUATION = fromString("PendingEvaluation"); + + /** Static value Granted for Status. */ + public static final Status GRANTED = fromString("Granted"); + + /** Static value Denied for Status. */ + public static final Status DENIED = fromString("Denied"); + + /** Static value PendingProvisioning for Status. */ + public static final Status PENDING_PROVISIONING = fromString("PendingProvisioning"); + + /** Static value Provisioned for Status. */ + public static final Status PROVISIONED = fromString("Provisioned"); + + /** Static value PendingRevocation for Status. */ + public static final Status PENDING_REVOCATION = fromString("PendingRevocation"); + + /** Static value Revoked for Status. */ + public static final Status REVOKED = fromString("Revoked"); + + /** Static value Canceled for Status. */ + public static final Status CANCELED = fromString("Canceled"); + + /** Static value Failed for Status. */ + public static final Status FAILED = fromString("Failed"); + + /** Static value PendingApprovalProvisioning for Status. */ + public static final Status PENDING_APPROVAL_PROVISIONING = fromString("PendingApprovalProvisioning"); + + /** Static value PendingApproval for Status. */ + public static final Status PENDING_APPROVAL = fromString("PendingApproval"); + + /** Static value FailedAsResourceIsLocked for Status. */ + public static final Status FAILED_AS_RESOURCE_IS_LOCKED = fromString("FailedAsResourceIsLocked"); + + /** Static value PendingAdminDecision for Status. */ + public static final Status PENDING_ADMIN_DECISION = fromString("PendingAdminDecision"); + + /** Static value AdminApproved for Status. */ + public static final Status ADMIN_APPROVED = fromString("AdminApproved"); + + /** Static value AdminDenied for Status. */ + public static final Status ADMIN_DENIED = fromString("AdminDenied"); + + /** Static value TimedOut for Status. */ + public static final Status TIMED_OUT = fromString("TimedOut"); + + /** Static value ProvisioningStarted for Status. */ + public static final Status PROVISIONING_STARTED = fromString("ProvisioningStarted"); + + /** Static value Invalid for Status. */ + public static final Status INVALID = fromString("Invalid"); + + /** Static value PendingScheduleCreation for Status. */ + public static final Status PENDING_SCHEDULE_CREATION = fromString("PendingScheduleCreation"); + + /** Static value ScheduleCreated for Status. */ + public static final Status SCHEDULE_CREATED = fromString("ScheduleCreated"); + + /** Static value PendingExternalProvisioning for Status. */ + public static final Status PENDING_EXTERNAL_PROVISIONING = fromString("PendingExternalProvisioning"); + + /** + * Creates a new instance of Status value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Status() { + } + + /** + * Creates or finds a Status from its string representation. + * + * @param name a name to look for. + * @return the corresponding Status. + */ + @JsonCreator + public static Status fromString(String name) { + return fromString(name, Status.class); + } + + /** + * Gets known Status values. + * + * @return known Status values. + */ + public static Collection values() { + return values(Status.class); + } +} 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 000000000000..c019d66b6a6f --- /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/TooManyOwnersAssignedToResourceAlertConfigurationProperties.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/TooManyOwnersAssignedToResourceAlertConfigurationProperties.java new file mode 100644 index 000000000000..b1d36c4eeaa6 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/TooManyOwnersAssignedToResourceAlertConfigurationProperties.java @@ -0,0 +1,96 @@ +// 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.AlertConfigurationPropertiesInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Too many owners assigned to resource alert configuration properties. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "alertConfigurationType") +@JsonTypeName("TooManyOwnersAssignedToResourceAlertConfiguration") +@Fluent +public final class TooManyOwnersAssignedToResourceAlertConfigurationProperties + extends AlertConfigurationPropertiesInner { + /* + * The threshold number of owners. + */ + @JsonProperty(value = "thresholdNumberOfOwners") + private Integer thresholdNumberOfOwners; + + /* + * The threshold percentage of owners out of all role members. + */ + @JsonProperty(value = "thresholdPercentageOfOwnersOutOfAllRoleMembers") + private Integer thresholdPercentageOfOwnersOutOfAllRoleMembers; + + /** Creates an instance of TooManyOwnersAssignedToResourceAlertConfigurationProperties class. */ + public TooManyOwnersAssignedToResourceAlertConfigurationProperties() { + } + + /** + * Get the thresholdNumberOfOwners property: The threshold number of owners. + * + * @return the thresholdNumberOfOwners value. + */ + public Integer thresholdNumberOfOwners() { + return this.thresholdNumberOfOwners; + } + + /** + * Set the thresholdNumberOfOwners property: The threshold number of owners. + * + * @param thresholdNumberOfOwners the thresholdNumberOfOwners value to set. + * @return the TooManyOwnersAssignedToResourceAlertConfigurationProperties object itself. + */ + public TooManyOwnersAssignedToResourceAlertConfigurationProperties withThresholdNumberOfOwners( + Integer thresholdNumberOfOwners) { + this.thresholdNumberOfOwners = thresholdNumberOfOwners; + return this; + } + + /** + * Get the thresholdPercentageOfOwnersOutOfAllRoleMembers property: The threshold percentage of owners out of all + * role members. + * + * @return the thresholdPercentageOfOwnersOutOfAllRoleMembers value. + */ + public Integer thresholdPercentageOfOwnersOutOfAllRoleMembers() { + return this.thresholdPercentageOfOwnersOutOfAllRoleMembers; + } + + /** + * Set the thresholdPercentageOfOwnersOutOfAllRoleMembers property: The threshold percentage of owners out of all + * role members. + * + * @param thresholdPercentageOfOwnersOutOfAllRoleMembers the thresholdPercentageOfOwnersOutOfAllRoleMembers value to + * set. + * @return the TooManyOwnersAssignedToResourceAlertConfigurationProperties object itself. + */ + public TooManyOwnersAssignedToResourceAlertConfigurationProperties + withThresholdPercentageOfOwnersOutOfAllRoleMembers(Integer thresholdPercentageOfOwnersOutOfAllRoleMembers) { + this.thresholdPercentageOfOwnersOutOfAllRoleMembers = thresholdPercentageOfOwnersOutOfAllRoleMembers; + return this; + } + + /** {@inheritDoc} */ + @Override + public TooManyOwnersAssignedToResourceAlertConfigurationProperties withIsEnabled(Boolean isEnabled) { + super.withIsEnabled(isEnabled); + return this; + } + + /** + * 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/TooManyOwnersAssignedToResourceAlertIncidentProperties.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/TooManyOwnersAssignedToResourceAlertIncidentProperties.java new file mode 100644 index 000000000000..fc4bfc40a911 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/TooManyOwnersAssignedToResourceAlertIncidentProperties.java @@ -0,0 +1,60 @@ +// 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; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Too many owners assigned to resource alert incident properties. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "alertIncidentType") +@JsonTypeName("TooManyOwnersAssignedToResourceAlertIncident") +@Immutable +public final class TooManyOwnersAssignedToResourceAlertIncidentProperties extends AlertIncidentProperties { + /* + * The assignee name. + */ + @JsonProperty(value = "assigneeName", access = JsonProperty.Access.WRITE_ONLY) + private String assigneeName; + + /* + * The assignee type. + */ + @JsonProperty(value = "assigneeType", access = JsonProperty.Access.WRITE_ONLY) + private String assigneeType; + + /** Creates an instance of TooManyOwnersAssignedToResourceAlertIncidentProperties class. */ + public TooManyOwnersAssignedToResourceAlertIncidentProperties() { + } + + /** + * Get the assigneeName property: The assignee name. + * + * @return the assigneeName value. + */ + public String assigneeName() { + return this.assigneeName; + } + + /** + * Get the assigneeType property: The assignee type. + * + * @return the assigneeType value. + */ + public String assigneeType() { + return this.assigneeType; + } + + /** + * 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/TooManyPermanentOwnersAssignedToResourceAlertConfigurationProperties.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/TooManyPermanentOwnersAssignedToResourceAlertConfigurationProperties.java new file mode 100644 index 000000000000..3f890c0579b4 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/TooManyPermanentOwnersAssignedToResourceAlertConfigurationProperties.java @@ -0,0 +1,97 @@ +// 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.AlertConfigurationPropertiesInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Too many permanent owners assigned to resource alert configuration properties. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "alertConfigurationType") +@JsonTypeName("TooManyPermanentOwnersAssignedToResourceAlertConfiguration") +@Fluent +public final class TooManyPermanentOwnersAssignedToResourceAlertConfigurationProperties + extends AlertConfigurationPropertiesInner { + /* + * The threshold number of permanent owners. + */ + @JsonProperty(value = "thresholdNumberOfPermanentOwners") + private Integer thresholdNumberOfPermanentOwners; + + /* + * The threshold percentage of permanent owners out of all owners. + */ + @JsonProperty(value = "thresholdPercentageOfPermanentOwnersOutOfAllOwners") + private Integer thresholdPercentageOfPermanentOwnersOutOfAllOwners; + + /** Creates an instance of TooManyPermanentOwnersAssignedToResourceAlertConfigurationProperties class. */ + public TooManyPermanentOwnersAssignedToResourceAlertConfigurationProperties() { + } + + /** + * Get the thresholdNumberOfPermanentOwners property: The threshold number of permanent owners. + * + * @return the thresholdNumberOfPermanentOwners value. + */ + public Integer thresholdNumberOfPermanentOwners() { + return this.thresholdNumberOfPermanentOwners; + } + + /** + * Set the thresholdNumberOfPermanentOwners property: The threshold number of permanent owners. + * + * @param thresholdNumberOfPermanentOwners the thresholdNumberOfPermanentOwners value to set. + * @return the TooManyPermanentOwnersAssignedToResourceAlertConfigurationProperties object itself. + */ + public TooManyPermanentOwnersAssignedToResourceAlertConfigurationProperties withThresholdNumberOfPermanentOwners( + Integer thresholdNumberOfPermanentOwners) { + this.thresholdNumberOfPermanentOwners = thresholdNumberOfPermanentOwners; + return this; + } + + /** + * Get the thresholdPercentageOfPermanentOwnersOutOfAllOwners property: The threshold percentage of permanent owners + * out of all owners. + * + * @return the thresholdPercentageOfPermanentOwnersOutOfAllOwners value. + */ + public Integer thresholdPercentageOfPermanentOwnersOutOfAllOwners() { + return this.thresholdPercentageOfPermanentOwnersOutOfAllOwners; + } + + /** + * Set the thresholdPercentageOfPermanentOwnersOutOfAllOwners property: The threshold percentage of permanent owners + * out of all owners. + * + * @param thresholdPercentageOfPermanentOwnersOutOfAllOwners the thresholdPercentageOfPermanentOwnersOutOfAllOwners + * value to set. + * @return the TooManyPermanentOwnersAssignedToResourceAlertConfigurationProperties object itself. + */ + public TooManyPermanentOwnersAssignedToResourceAlertConfigurationProperties + withThresholdPercentageOfPermanentOwnersOutOfAllOwners( + Integer thresholdPercentageOfPermanentOwnersOutOfAllOwners) { + this.thresholdPercentageOfPermanentOwnersOutOfAllOwners = thresholdPercentageOfPermanentOwnersOutOfAllOwners; + return this; + } + + /** {@inheritDoc} */ + @Override + public TooManyPermanentOwnersAssignedToResourceAlertConfigurationProperties withIsEnabled(Boolean isEnabled) { + super.withIsEnabled(isEnabled); + return this; + } + + /** + * 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/TooManyPermanentOwnersAssignedToResourceAlertIncidentProperties.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/TooManyPermanentOwnersAssignedToResourceAlertIncidentProperties.java new file mode 100644 index 000000000000..8d85ae8e4fd8 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/TooManyPermanentOwnersAssignedToResourceAlertIncidentProperties.java @@ -0,0 +1,60 @@ +// 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; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Too many permanent owners assigned to resource alert incident properties. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "alertIncidentType") +@JsonTypeName("TooManyPermanentOwnersAssignedToResourceAlertIncident") +@Immutable +public final class TooManyPermanentOwnersAssignedToResourceAlertIncidentProperties extends AlertIncidentProperties { + /* + * The assignee name. + */ + @JsonProperty(value = "assigneeName", access = JsonProperty.Access.WRITE_ONLY) + private String assigneeName; + + /* + * The assignee type. + */ + @JsonProperty(value = "assigneeType", access = JsonProperty.Access.WRITE_ONLY) + private String assigneeType; + + /** Creates an instance of TooManyPermanentOwnersAssignedToResourceAlertIncidentProperties class. */ + public TooManyPermanentOwnersAssignedToResourceAlertIncidentProperties() { + } + + /** + * Get the assigneeName property: The assignee name. + * + * @return the assigneeName value. + */ + public String assigneeName() { + return this.assigneeName; + } + + /** + * Get the assigneeType property: The assignee type. + * + * @return the assigneeType value. + */ + public String assigneeType() { + return this.assigneeType; + } + + /** + * 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/Type.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/Type.java new file mode 100644 index 000000000000..98e309c1e153 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/Type.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Type of the role assignment schedule expiration. */ +public final class Type extends ExpandableStringEnum { + /** Static value AfterDuration for Type. */ + public static final Type AFTER_DURATION = fromString("AfterDuration"); + + /** Static value AfterDateTime for Type. */ + public static final Type AFTER_DATE_TIME = fromString("AfterDateTime"); + + /** Static value NoExpiration for Type. */ + public static final Type NO_EXPIRATION = fromString("NoExpiration"); + + /** + * Creates a new instance of Type value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Type() { + } + + /** + * Creates or finds a Type from its string representation. + * + * @param name a name to look for. + * @return the corresponding Type. + */ + @JsonCreator + public static Type fromString(String name) { + return fromString(name, Type.class); + } + + /** + * Gets known Type values. + * + * @return known Type values. + */ + public static Collection values() { + return values(Type.class); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/UserSet.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/UserSet.java new file mode 100644 index 000000000000..6740e5a7f469 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/UserSet.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The detail of a user. */ +@Fluent +public final class UserSet { + /* + * The type of user. + */ + @JsonProperty(value = "userType") + private UserType userType; + + /* + * The value indicating whether the user is a backup fallback approver + */ + @JsonProperty(value = "isBackup") + private Boolean isBackup; + + /* + * The object id of the user. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The description of the user. + */ + @JsonProperty(value = "description") + private String description; + + /** Creates an instance of UserSet class. */ + public UserSet() { + } + + /** + * Get the userType property: The type of user. + * + * @return the userType value. + */ + public UserType userType() { + return this.userType; + } + + /** + * Set the userType property: The type of user. + * + * @param userType the userType value to set. + * @return the UserSet object itself. + */ + public UserSet withUserType(UserType userType) { + this.userType = userType; + return this; + } + + /** + * Get the isBackup property: The value indicating whether the user is a backup fallback approver. + * + * @return the isBackup value. + */ + public Boolean isBackup() { + return this.isBackup; + } + + /** + * Set the isBackup property: The value indicating whether the user is a backup fallback approver. + * + * @param isBackup the isBackup value to set. + * @return the UserSet object itself. + */ + public UserSet withIsBackup(Boolean isBackup) { + this.isBackup = isBackup; + return this; + } + + /** + * Get the id property: The object id of the user. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The object id of the user. + * + * @param id the id value to set. + * @return the UserSet object itself. + */ + public UserSet withId(String id) { + this.id = id; + return this; + } + + /** + * Get the description property: The description of the user. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the user. + * + * @param description the description value to set. + * @return the UserSet object itself. + */ + public UserSet withDescription(String description) { + this.description = description; + 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/UserType.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/UserType.java new file mode 100644 index 000000000000..6ccfd2c0713a --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/UserType.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 type of user. */ +public final class UserType extends ExpandableStringEnum { + /** Static value User for UserType. */ + public static final UserType USER = fromString("User"); + + /** Static value Group for UserType. */ + public static final UserType GROUP = fromString("Group"); + + /** + * Creates a new instance of UserType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public UserType() { + } + + /** + * Creates or finds a UserType from its string representation. + * + * @param name a name to look for. + * @return the corresponding UserType. + */ + @JsonCreator + public static UserType fromString(String name) { + return fromString(name, UserType.class); + } + + /** + * Gets known UserType values. + * + * @return known UserType values. + */ + public static Collection values() { + return values(UserType.class); + } +} 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 000000000000..30b39fb2d4c9 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/models/package-info.java @@ -0,0 +1,11 @@ +// 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. Role based access control provides you a way to + * apply granular level policy administration down to individual resources or resource groups. These operations enable + * you to manage role definitions and role assignments. A role definition describes the set of actions that can be + * performed on resources. A role assignment grants access to Azure Active Directory users. + */ +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 000000000000..72ffd0b54cf8 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/main/java/com/azure/resourcemanager/authorization/generated/package-info.java @@ -0,0 +1,11 @@ +// 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. Role based access control provides you a way to + * apply granular level policy administration down to individual resources or resource groups. These operations enable + * you to manage role definitions and role assignments. A role definition describes the set of actions that can be + * performed on resources. A role assignment grants access to Azure Active Directory users. + */ +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 000000000000..ff6e8e09354d --- /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 000000000000..8387c7dcc7c2 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AccessReviewInstanceMyDecisionsGetByIdSamples.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; + +/** 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", + com.azure.core.util.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 000000000000..e5d47e76f322 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AccessReviewInstanceMyDecisionsListSamples.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; + +/** 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, + com.azure.core.util.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 000000000000..9d44eba8cd63 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AccessReviewInstanceMyDecisionsPatchSamples.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.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(), + com.azure.core.util.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 000000000000..3267731a316f --- /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; + +/** 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", + com.azure.core.util.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 000000000000..28119faec93f --- /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; + +/** 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", + com.azure.core.util.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 000000000000..47a2cea7a43a --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AccessReviewInstancesAssignedForMyApprovalListSamples.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; + +/** 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()", com.azure.core.util.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 000000000000..1a5ad5bac027 --- /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; + +/** 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()", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertConfigurationsGetSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertConfigurationsGetSamples.java new file mode 100644 index 000000000000..ed1b195e4088 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertConfigurationsGetSamples.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; + +/** Samples for AlertConfigurations Get. */ +public final class AlertConfigurationsGetSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-08-01-preview/examples/GetAlertConfigurationById.json + */ + /** + * Sample code: GetAlertConfigurationById. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAlertConfigurationById( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .alertConfigurations() + .getWithResponse( + "subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", + "TooManyOwnersAssignedToResource", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertConfigurationsListForScopeSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertConfigurationsListForScopeSamples.java new file mode 100644 index 000000000000..5d224502a3f7 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertConfigurationsListForScopeSamples.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; + +/** Samples for AlertConfigurations ListForScope. */ +public final class AlertConfigurationsListForScopeSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-08-01-preview/examples/GetAlertConfigurations.json + */ + /** + * Sample code: GetAlertConfigurations. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAlertConfigurations( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .alertConfigurations() + .listForScope("subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertConfigurationsUpdateSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertConfigurationsUpdateSamples.java new file mode 100644 index 000000000000..c7bf9a0f1cef --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertConfigurationsUpdateSamples.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.generated; + +import com.azure.resourcemanager.authorization.generated.fluent.models.AlertConfigurationInner; +import com.azure.resourcemanager.authorization.generated.models.TooManyOwnersAssignedToResourceAlertConfigurationProperties; + +/** Samples for AlertConfigurations Update. */ +public final class AlertConfigurationsUpdateSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-08-01-preview/examples/UpdateAlertConfiguration.json + */ + /** + * Sample code: UpdateAlertConfiguration. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void updateAlertConfiguration( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .alertConfigurations() + .updateWithResponse( + "subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", + "TooManyOwnersAssignedToResource", + new AlertConfigurationInner() + .withProperties( + new TooManyOwnersAssignedToResourceAlertConfigurationProperties() + .withIsEnabled(true) + .withThresholdNumberOfOwners(2)), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertDefinitionsGetSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertDefinitionsGetSamples.java new file mode 100644 index 000000000000..754bf0a29b71 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertDefinitionsGetSamples.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; + +/** Samples for AlertDefinitions Get. */ +public final class AlertDefinitionsGetSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-08-01-preview/examples/GetAlertDefinitionById.json + */ + /** + * Sample code: GetAlertDefinitionById. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAlertDefinitionById( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .alertDefinitions() + .getWithResponse( + "subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", + "TooManyPermanentOwnersAssignedToResource", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertDefinitionsListForScopeSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertDefinitionsListForScopeSamples.java new file mode 100644 index 000000000000..7b451cffd28b --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertDefinitionsListForScopeSamples.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; + +/** Samples for AlertDefinitions ListForScope. */ +public final class AlertDefinitionsListForScopeSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-08-01-preview/examples/GetAlertDefinitions.json + */ + /** + * Sample code: GetAlertDefinitions. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAlertDefinitions( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .alertDefinitions() + .listForScope("subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertIncidentsGetSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertIncidentsGetSamples.java new file mode 100644 index 000000000000..b7daabf7667a --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertIncidentsGetSamples.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; + +/** Samples for AlertIncidents Get. */ +public final class AlertIncidentsGetSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-08-01-preview/examples/GetAlertIncidentById.json + */ + /** + * Sample code: GetAlertIncidentById. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAlertIncidentById( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .alertIncidents() + .getWithResponse( + "subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", + "TooManyOwnersAssignedToResource", + "5cf9ee65-d22e-4784-8b17-3de1c3b7bdcc", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertIncidentsListForScopeSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertIncidentsListForScopeSamples.java new file mode 100644 index 000000000000..1bcf5c9c6f2e --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertIncidentsListForScopeSamples.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; + +/** Samples for AlertIncidents ListForScope. */ +public final class AlertIncidentsListForScopeSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-08-01-preview/examples/GetAlertIncidents.json + */ + /** + * Sample code: GetAlertIncidents. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAlertIncidents( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .alertIncidents() + .listForScope( + "subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", + "TooManyOwnersAssignedToResource", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertIncidentsRemediateSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertIncidentsRemediateSamples.java new file mode 100644 index 000000000000..3404cd328ded --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertIncidentsRemediateSamples.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; + +/** Samples for AlertIncidents Remediate. */ +public final class AlertIncidentsRemediateSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-08-01-preview/examples/RemediateAlertIncident.json + */ + /** + * Sample code: RemediateAlertIncident. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void remediateAlertIncident( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .alertIncidents() + .remediateWithResponse( + "subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", + "DuplicateRoleCreated", + "0645231d-16ba-4ebf-851a-0875df4052bd", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertOperationGetSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertOperationGetSamples.java new file mode 100644 index 000000000000..f2d4020ce71d --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertOperationGetSamples.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; + +/** Samples for AlertOperation Get. */ +public final class AlertOperationGetSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-08-01-preview/examples/GetAlertOperationById.json + */ + /** + * Sample code: GetAlertOperation. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAlertOperation( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .alertOperations() + .getWithResponse( + "subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", + "{operationId}", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertsGetSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertsGetSamples.java new file mode 100644 index 000000000000..b94870a40730 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertsGetSamples.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; + +/** Samples for Alerts Get. */ +public final class AlertsGetSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-08-01-preview/examples/GetAlertById.json + */ + /** + * Sample code: GetAlertById. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAlertById(com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .alerts() + .getWithResponse( + "subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", + "TooManyOwnersAssignedToResource", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertsListForScopeSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertsListForScopeSamples.java new file mode 100644 index 000000000000..ab6a98902388 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertsListForScopeSamples.java @@ -0,0 +1,22 @@ +// 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; + +/** Samples for Alerts ListForScope. */ +public final class AlertsListForScopeSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-08-01-preview/examples/GetAlerts.json + */ + /** + * Sample code: GetAlerts. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAlerts(com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .alerts() + .listForScope("subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertsRefreshAllSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertsRefreshAllSamples.java new file mode 100644 index 000000000000..d43bc94fb85d --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertsRefreshAllSamples.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; + +/** Samples for Alerts RefreshAll. */ +public final class AlertsRefreshAllSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-08-01-preview/examples/RefreshAllAlerts.json + */ + /** + * Sample code: RefreshAllAlerts. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void refreshAllAlerts( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .alerts() + .refreshAll("subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertsRefreshSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertsRefreshSamples.java new file mode 100644 index 000000000000..b194642675bc --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertsRefreshSamples.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; + +/** Samples for Alerts Refresh. */ +public final class AlertsRefreshSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-08-01-preview/examples/RefreshAlert.json + */ + /** + * Sample code: RefreshAlert. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void refreshAlert(com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .alerts() + .refresh( + "subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", + "AzureRolesAssignedOutsidePimAlert", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertsUpdateSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertsUpdateSamples.java new file mode 100644 index 000000000000..5fa2520ab935 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/AlertsUpdateSamples.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.resourcemanager.authorization.generated.fluent.models.AlertInner; + +/** Samples for Alerts Update. */ +public final class AlertsUpdateSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-08-01-preview/examples/UpdateAlert.json + */ + /** + * Sample code: DeactivateAlert. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void deactivateAlert(com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .alerts() + .updateWithResponse( + "subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", + "TooManyPermanentOwnersAssignedToResource", + new AlertInner().withIsActive(false), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ClassicAdministratorsListSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ClassicAdministratorsListSamples.java new file mode 100644 index 000000000000..e17ec7aca810 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ClassicAdministratorsListSamples.java @@ -0,0 +1,21 @@ +// 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; + +/** Samples for ClassicAdministrators List. */ +public final class ClassicAdministratorsListSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2015-07-01/examples/GetClassicAdministrators.json + */ + /** + * Sample code: List classic administrators. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void listClassicAdministrators( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager.classicAdministrators().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/DenyAssignmentsGetByIdSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/DenyAssignmentsGetByIdSamples.java new file mode 100644 index 000000000000..abacb81311a1 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/DenyAssignmentsGetByIdSamples.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; + +/** Samples for DenyAssignments GetById. */ +public final class DenyAssignmentsGetByIdSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/GetDenyAssignmentById.json + */ + /** + * Sample code: Get deny assignment by ID. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getDenyAssignmentByID( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .denyAssignments() + .getByIdWithResponse( + "subscriptions/subId/resourcegroups/rgname/providers/Microsoft.Authorization/denyAssignments/daId", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/DenyAssignmentsGetSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/DenyAssignmentsGetSamples.java new file mode 100644 index 000000000000..5e2df7c3f9e6 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/DenyAssignmentsGetSamples.java @@ -0,0 +1,24 @@ +// 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; + +/** Samples for DenyAssignments Get. */ +public final class DenyAssignmentsGetSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/GetDenyAssignmentByNameId.json + */ + /** + * Sample code: Get deny assignment by name. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getDenyAssignmentByName( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .denyAssignments() + .getWithResponse( + "subscriptions/subId/resourcegroups/rgname", "denyAssignmentId", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/DenyAssignmentsListByResourceGroupSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/DenyAssignmentsListByResourceGroupSamples.java new file mode 100644 index 000000000000..122c752d0d51 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/DenyAssignmentsListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// 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; + +/** Samples for DenyAssignments ListByResourceGroup. */ +public final class DenyAssignmentsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/GetDenyAssignmentsForResourceGroup.json + */ + /** + * Sample code: List deny assignments for resource group. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void listDenyAssignmentsForResourceGroup( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager.denyAssignments().listByResourceGroup("rgname", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/DenyAssignmentsListForResourceSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/DenyAssignmentsListForResourceSamples.java new file mode 100644 index 000000000000..f63e0bd1094c --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/DenyAssignmentsListForResourceSamples.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; + +/** Samples for DenyAssignments ListForResource. */ +public final class DenyAssignmentsListForResourceSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/GetDenyAssignmentsForResource.json + */ + /** + * Sample code: List deny assignments for resource. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void listDenyAssignmentsForResource( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .denyAssignments() + .listForResource( + "rgname", + "resourceProviderNamespace", + "parentResourcePath", + "resourceType", + "resourceName", + null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/DenyAssignmentsListForScopeSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/DenyAssignmentsListForScopeSamples.java new file mode 100644 index 000000000000..18a89f9f5ed9 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/DenyAssignmentsListForScopeSamples.java @@ -0,0 +1,21 @@ +// 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; + +/** Samples for DenyAssignments ListForScope. */ +public final class DenyAssignmentsListForScopeSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/GetDenyAssignmentByScope.json + */ + /** + * Sample code: List deny assignments for scope. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void listDenyAssignmentsForScope( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager.denyAssignments().listForScope("subscriptions/subId", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/DenyAssignmentsListSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/DenyAssignmentsListSamples.java new file mode 100644 index 000000000000..9adb64150ca3 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/DenyAssignmentsListSamples.java @@ -0,0 +1,21 @@ +// 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; + +/** Samples for DenyAssignments List. */ +public final class DenyAssignmentsListSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/GetAllDenyAssignments.json + */ + /** + * Sample code: List deny assignments for subscription. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void listDenyAssignmentsForSubscription( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager.denyAssignments().list(null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/EligibleChildResourcesGetSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/EligibleChildResourcesGetSamples.java new file mode 100644 index 000000000000..6eee87604fea --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/EligibleChildResourcesGetSamples.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; + +/** Samples for EligibleChildResources Get. */ +public final class EligibleChildResourcesGetSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/examples/GetEligibleChildResourcesByScope.json + */ + /** + * Sample code: GetEligibleChildResourcesByScope. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getEligibleChildResourcesByScope( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .eligibleChildResources() + .get( + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "resourceType eq 'resourcegroup'", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/GlobalAdministratorElevateAccessSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/GlobalAdministratorElevateAccessSamples.java new file mode 100644 index 000000000000..e70f0347dac2 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/GlobalAdministratorElevateAccessSamples.java @@ -0,0 +1,21 @@ +// 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; + +/** Samples for GlobalAdministrator ElevateAccess. */ +public final class GlobalAdministratorElevateAccessSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2015-07-01/examples/ElevateAccess.json + */ + /** + * Sample code: Elevate access global administrator. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void elevateAccessGlobalAdministrator( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager.globalAdministrators().elevateAccessWithResponse(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/PermissionsListByResourceGroupSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/PermissionsListByResourceGroupSamples.java new file mode 100644 index 000000000000..edee5ea6a528 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/PermissionsListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// 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; + +/** Samples for Permissions ListByResourceGroup. */ +public final class PermissionsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-05-01-preview/examples/GetPermissions.json + */ + /** + * Sample code: List permissions for resource group. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void listPermissionsForResourceGroup( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager.permissions().listByResourceGroup("rgname", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/PermissionsListForResourceSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/PermissionsListForResourceSamples.java new file mode 100644 index 000000000000..ad8eefbe9480 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/PermissionsListForResourceSamples.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; + +/** Samples for Permissions ListForResource. */ +public final class PermissionsListForResourceSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-05-01-preview/examples/GetResourcePermissions.json + */ + /** + * Sample code: List permissions for resource. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void listPermissionsForResource( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .permissions() + .listForResource( + "rgname", + "rpnamespace", + "parentResourcePath", + "resourceType", + "resourceName", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ProviderOperationsMetadataGetSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ProviderOperationsMetadataGetSamples.java new file mode 100644 index 000000000000..42d9560b4a7f --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ProviderOperationsMetadataGetSamples.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; + +/** Samples for ProviderOperationsMetadata Get. */ +public final class ProviderOperationsMetadataGetSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/GetProviderOperationsRP.json + */ + /** + * Sample code: List provider operations metadata for resource provider. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void listProviderOperationsMetadataForResourceProvider( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .providerOperationsMetadatas() + .getWithResponse("resourceProviderNamespace", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ProviderOperationsMetadataListSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ProviderOperationsMetadataListSamples.java new file mode 100644 index 000000000000..06a20368dda9 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ProviderOperationsMetadataListSamples.java @@ -0,0 +1,21 @@ +// 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; + +/** Samples for ProviderOperationsMetadata List. */ +public final class ProviderOperationsMetadataListSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/GetAllProviderOperations.json + */ + /** + * Sample code: List provider operations metadata for all resource providers. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void listProviderOperationsMetadataForAllResourceProviders( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager.providerOperationsMetadatas().list(null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentScheduleInstancesGetSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentScheduleInstancesGetSamples.java new file mode 100644 index 000000000000..0274222bb5c2 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentScheduleInstancesGetSamples.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; + +/** Samples for RoleAssignmentScheduleInstances Get. */ +public final class RoleAssignmentScheduleInstancesGetSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/examples/GetRoleAssignmentScheduleInstanceByName.json + */ + /** + * Sample code: GetRoleAssignmentScheduleInstanceByName. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleAssignmentScheduleInstanceByName( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleAssignmentScheduleInstances() + .getWithResponse( + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "ed9b8180-cef7-4c77-a63c-b8566ecfc412", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentScheduleInstancesListForScopeSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentScheduleInstancesListForScopeSamples.java new file mode 100644 index 000000000000..51515815cb18 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentScheduleInstancesListForScopeSamples.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; + +/** Samples for RoleAssignmentScheduleInstances ListForScope. */ +public final class RoleAssignmentScheduleInstancesListForScopeSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/examples/GetRoleAssignmentScheduleInstancesByScope.json + */ + /** + * Sample code: GetRoleAssignmentScheduleInstancesByScope. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleAssignmentScheduleInstancesByScope( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleAssignmentScheduleInstances() + .listForScope( + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "assignedTo('a3bb8764-cb92-4276-9d2a-ca1e895e55ea')", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentScheduleRequestsCancelSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentScheduleRequestsCancelSamples.java new file mode 100644 index 000000000000..1fd8e05f21c2 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentScheduleRequestsCancelSamples.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; + +/** Samples for RoleAssignmentScheduleRequests Cancel. */ +public final class RoleAssignmentScheduleRequestsCancelSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-04-01-preview/examples/CancelRoleAssignmentScheduleRequestByName.json + */ + /** + * Sample code: CancelRoleAssignmentScheduleRequestByName. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void cancelRoleAssignmentScheduleRequestByName( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleAssignmentScheduleRequests() + .cancelWithResponse( + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "fea7a502-9a96-4806-a26f-eee560e52045", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentScheduleRequestsCreateSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentScheduleRequestsCreateSamples.java new file mode 100644 index 000000000000..64e9c51452da --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentScheduleRequestsCreateSamples.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.generated; + +import com.azure.resourcemanager.authorization.generated.models.RequestType; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignmentScheduleRequestPropertiesScheduleInfo; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration; +import com.azure.resourcemanager.authorization.generated.models.Type; +import java.time.OffsetDateTime; + +/** Samples for RoleAssignmentScheduleRequests Create. */ +public final class RoleAssignmentScheduleRequestsCreateSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-04-01-preview/examples/PutRoleAssignmentScheduleRequest.json + */ + /** + * Sample code: PutRoleAssignmentScheduleRequest. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void putRoleAssignmentScheduleRequest( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleAssignmentScheduleRequests() + .define("fea7a502-9a96-4806-a26f-eee560e52045") + .withExistingScope("providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f") + .withRoleDefinitionId( + "/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f/providers/Microsoft.Authorization/roleDefinitions/c8d4ff99-41c3-41a8-9f60-21dfdad59608") + .withPrincipalId("a3bb8764-cb92-4276-9d2a-ca1e895e55ea") + .withRequestType(RequestType.SELF_ACTIVATE) + .withScheduleInfo( + new RoleAssignmentScheduleRequestPropertiesScheduleInfo() + .withStartDateTime(OffsetDateTime.parse("2020-09-09T21:35:27.91Z")) + .withExpiration( + new RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration() + .withType(Type.AFTER_DURATION) + .withDuration("PT8H"))) + .withLinkedRoleEligibilityScheduleId("b1477448-2cc6-4ceb-93b4-54a202a89413") + .withCondition( + "@Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName]" + + " StringEqualsIgnoreCase 'foo_storage_container'") + .withConditionVersion("1.0") + .create(); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentScheduleRequestsGetSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentScheduleRequestsGetSamples.java new file mode 100644 index 000000000000..97bdc18bbb4b --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentScheduleRequestsGetSamples.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; + +/** Samples for RoleAssignmentScheduleRequests Get. */ +public final class RoleAssignmentScheduleRequestsGetSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-04-01-preview/examples/GetRoleAssignmentScheduleRequestByName.json + */ + /** + * Sample code: GetRoleAssignmentScheduleRequestByName. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleAssignmentScheduleRequestByName( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleAssignmentScheduleRequests() + .getWithResponse( + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "fea7a502-9a96-4806-a26f-eee560e52045", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentScheduleRequestsListForScopeSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentScheduleRequestsListForScopeSamples.java new file mode 100644 index 000000000000..fbfb6736abf9 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentScheduleRequestsListForScopeSamples.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; + +/** Samples for RoleAssignmentScheduleRequests ListForScope. */ +public final class RoleAssignmentScheduleRequestsListForScopeSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-04-01-preview/examples/GetRoleAssignmentScheduleRequestByScope.json + */ + /** + * Sample code: GetRoleAssignmentScheduleRequestByScope. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleAssignmentScheduleRequestByScope( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleAssignmentScheduleRequests() + .listForScope( + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "assignedTo('A3BB8764-CB92-4276-9D2A-CA1E895E55EA')", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentScheduleRequestsValidateSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentScheduleRequestsValidateSamples.java new file mode 100644 index 000000000000..1d0dbdf73fa2 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentScheduleRequestsValidateSamples.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.generated; + +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleAssignmentScheduleRequestInner; +import com.azure.resourcemanager.authorization.generated.models.RequestType; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignmentScheduleRequestPropertiesScheduleInfo; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration; +import com.azure.resourcemanager.authorization.generated.models.Type; +import java.time.OffsetDateTime; + +/** Samples for RoleAssignmentScheduleRequests Validate. */ +public final class RoleAssignmentScheduleRequestsValidateSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-04-01-preview/examples/ValidateRoleAssignmentScheduleRequestByName.json + */ + /** + * Sample code: ValidateRoleAssignmentScheduleRequestByName. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void validateRoleAssignmentScheduleRequestByName( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleAssignmentScheduleRequests() + .validateWithResponse( + "subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "fea7a502-9a96-4806-a26f-eee560e52045", + new RoleAssignmentScheduleRequestInner() + .withRoleDefinitionId( + "/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f/providers/Microsoft.Authorization/roleDefinitions/c8d4ff99-41c3-41a8-9f60-21dfdad59608") + .withPrincipalId("a3bb8764-cb92-4276-9d2a-ca1e895e55ea") + .withRequestType(RequestType.SELF_ACTIVATE) + .withScheduleInfo( + new RoleAssignmentScheduleRequestPropertiesScheduleInfo() + .withStartDateTime(OffsetDateTime.parse("2020-09-09T21:35:27.91Z")) + .withExpiration( + new RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration() + .withType(Type.AFTER_DURATION) + .withDuration("PT8H"))) + .withLinkedRoleEligibilityScheduleId("b1477448-2cc6-4ceb-93b4-54a202a89413") + .withCondition( + "@Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName]" + + " StringEqualsIgnoreCase 'foo_storage_container'") + .withConditionVersion("1.0"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentSchedulesGetSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentSchedulesGetSamples.java new file mode 100644 index 000000000000..751789feea48 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentSchedulesGetSamples.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; + +/** Samples for RoleAssignmentSchedules Get. */ +public final class RoleAssignmentSchedulesGetSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/examples/GetRoleAssignmentScheduleByName.json + */ + /** + * Sample code: GetRoleAssignmentScheduleByName. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleAssignmentScheduleByName( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleAssignmentSchedules() + .getWithResponse( + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "c9e264ff-3133-4776-a81a-ebc7c33c8ec6", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentSchedulesListForScopeSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentSchedulesListForScopeSamples.java new file mode 100644 index 000000000000..52d77f72b218 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentSchedulesListForScopeSamples.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; + +/** Samples for RoleAssignmentSchedules ListForScope. */ +public final class RoleAssignmentSchedulesListForScopeSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/examples/GetRoleAssignmentSchedulesByScope.json + */ + /** + * Sample code: GetRoleAssignmentSchedulesByScope. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleAssignmentSchedulesByScope( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleAssignmentSchedules() + .listForScope( + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "assignedTo('a3bb8764-cb92-4276-9d2a-ca1e895e55ea')", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsCreateByIdSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsCreateByIdSamples.java new file mode 100644 index 000000000000..9d552f52ebb6 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsCreateByIdSamples.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.generated; + +import com.azure.resourcemanager.authorization.generated.models.PrincipalType; +import com.azure.resourcemanager.authorization.generated.models.RoleAssignmentCreateParameters; + +/** Samples for RoleAssignments CreateById. */ +public final class RoleAssignmentsCreateByIdSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/RoleAssignments_CreateById.json + */ + /** + * Sample code: Create or update role assignment by ID. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void createOrUpdateRoleAssignmentByID( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleAssignments() + .createByIdWithResponse( + "subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleAssignments/b0f43c54-e787-4862-89b1-a653fa9cf747", + new RoleAssignmentCreateParameters() + .withRoleDefinitionId( + "/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d") + .withPrincipalId("ce2ce14e-85d7-4629-bdbc-454d0519d987") + .withPrincipalType(PrincipalType.USER), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsCreateSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsCreateSamples.java new file mode 100644 index 000000000000..20015311cc2b --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsCreateSamples.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.generated; + +import com.azure.resourcemanager.authorization.generated.models.PrincipalType; + +/** Samples for RoleAssignments Create. */ +public final class RoleAssignmentsCreateSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/RoleAssignments_CreateForSubscription.json + */ + /** + * Sample code: Create role assignment for subscription. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void createRoleAssignmentForSubscription( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleAssignments() + .define("05c5a614-a7d6-4502-b150-c2fb455033ff") + .withExistingScope("subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2") + .withRoleDefinitionId( + "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d") + .withPrincipalId("ce2ce14e-85d7-4629-bdbc-454d0519d987") + .withPrincipalType(PrincipalType.USER) + .create(); + } + + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/RoleAssignments_CreateForResourceGroup.json + */ + /** + * Sample code: Create role assignment for resource group. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void createRoleAssignmentForResourceGroup( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleAssignments() + .define("05c5a614-a7d6-4502-b150-c2fb455033ff") + .withExistingScope("subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/resourceGroups/testrg") + .withRoleDefinitionId( + "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d") + .withPrincipalId("ce2ce14e-85d7-4629-bdbc-454d0519d987") + .withPrincipalType(PrincipalType.USER) + .create(); + } + + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/RoleAssignments_CreateForResource.json + */ + /** + * Sample code: Create role assignment for resource. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void createRoleAssignmentForResource( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleAssignments() + .define("05c5a614-a7d6-4502-b150-c2fb455033ff") + .withExistingScope( + "subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/resourceGroups/testrg/providers/Microsoft.DocumentDb/databaseAccounts/test-db-account") + .withRoleDefinitionId( + "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d") + .withPrincipalId("ce2ce14e-85d7-4629-bdbc-454d0519d987") + .withPrincipalType(PrincipalType.USER) + .create(); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsDeleteByIdSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsDeleteByIdSamples.java new file mode 100644 index 000000000000..e3ee66dee52c --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsDeleteByIdSamples.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; + +/** Samples for RoleAssignments DeleteById. */ +public final class RoleAssignmentsDeleteByIdSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/RoleAssignments_DeleteById.json + */ + /** + * Sample code: Delete role assignment by ID. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void deleteRoleAssignmentByID( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleAssignments() + .deleteByIdWithResponse( + "subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleAssignments/b0f43c54-e787-4862-89b1-a653fa9cf747", + null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsDeleteSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsDeleteSamples.java new file mode 100644 index 000000000000..368d2e1a2408 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsDeleteSamples.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; + +/** Samples for RoleAssignments Delete. */ +public final class RoleAssignmentsDeleteSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/RoleAssignments_Delete.json + */ + /** + * Sample code: Delete role assignment. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void deleteRoleAssignment( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleAssignments() + .deleteWithResponse( + "subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2", + "b0f43c54-e787-4862-89b1-a653fa9cf747", + null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsGetByIdSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsGetByIdSamples.java new file mode 100644 index 000000000000..b461f3f75713 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsGetByIdSamples.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; + +/** Samples for RoleAssignments GetById. */ +public final class RoleAssignmentsGetByIdSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/RoleAssignments_GetById.json + */ + /** + * Sample code: Get role assignment by ID. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleAssignmentByID( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleAssignments() + .getByIdWithResponse( + "subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleAssignments/b0f43c54-e787-4862-89b1-a653fa9cf747", + null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsGetSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsGetSamples.java new file mode 100644 index 000000000000..ae00acb5b6f7 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsGetSamples.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; + +/** Samples for RoleAssignments Get. */ +public final class RoleAssignmentsGetSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/RoleAssignments_Get.json + */ + /** + * Sample code: Get role assignment by scope and name. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleAssignmentByScopeAndName( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleAssignments() + .getWithResponse( + "subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2", + "b0f43c54-e787-4862-89b1-a653fa9cf747", + null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsListByResourceGroupSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsListByResourceGroupSamples.java new file mode 100644 index 000000000000..a69d640a2ae1 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// 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; + +/** Samples for RoleAssignments ListByResourceGroup. */ +public final class RoleAssignmentsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/RoleAssignments_ListForResourceGroup.json + */ + /** + * Sample code: List role assignments for resource group. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void listRoleAssignmentsForResourceGroup( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager.roleAssignments().listByResourceGroup("testrg", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsListForResourceSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsListForResourceSamples.java new file mode 100644 index 000000000000..57b1fff9d9d0 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsListForResourceSamples.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; + +/** Samples for RoleAssignments ListForResource. */ +public final class RoleAssignmentsListForResourceSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/RoleAssignments_ListForResource.json + */ + /** + * Sample code: List role assignments for a resource. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void listRoleAssignmentsForAResource( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleAssignments() + .listForResource( + "testrg", + "Microsoft.DocumentDb", + "databaseAccounts", + "test-db-account", + null, + null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsListForScopeSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsListForScopeSamples.java new file mode 100644 index 000000000000..564ebd6736ab --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsListForScopeSamples.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; + +/** Samples for RoleAssignments ListForScope. */ +public final class RoleAssignmentsListForScopeSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/RoleAssignments_ListForScope.json + */ + /** + * Sample code: List role assignments for scope. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void listRoleAssignmentsForScope( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleAssignments() + .listForScope( + "subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2", + null, + null, + null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsListSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsListSamples.java new file mode 100644 index 000000000000..424380dc1091 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleAssignmentsListSamples.java @@ -0,0 +1,21 @@ +// 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; + +/** Samples for RoleAssignments List. */ +public final class RoleAssignmentsListSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/examples/RoleAssignments_ListForSubscription.json + */ + /** + * Sample code: List role assignments for subscription. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void listRoleAssignmentsForSubscription( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager.roleAssignments().list(null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleDefinitionsCreateOrUpdateSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleDefinitionsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..da0c6f50e39d --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleDefinitionsCreateOrUpdateSamples.java @@ -0,0 +1,21 @@ +// 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; + +/** Samples for RoleDefinitions CreateOrUpdate. */ +public final class RoleDefinitionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-05-01-preview/examples/PutRoleDefinition.json + */ + /** + * Sample code: Create role definition. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void createRoleDefinition( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager.roleDefinitions().define("roleDefinitionId").withExistingScope("scope").create(); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleDefinitionsDeleteSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleDefinitionsDeleteSamples.java new file mode 100644 index 000000000000..608f3d58aa9e --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleDefinitionsDeleteSamples.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; + +/** Samples for RoleDefinitions Delete. */ +public final class RoleDefinitionsDeleteSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-05-01-preview/examples/DeleteRoleDefinition.json + */ + /** + * Sample code: Delete role definition. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void deleteRoleDefinition( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleDefinitions() + .deleteByResourceGroupWithResponse("scope", "roleDefinitionId", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleDefinitionsGetByIdSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleDefinitionsGetByIdSamples.java new file mode 100644 index 000000000000..b54948b7d64b --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleDefinitionsGetByIdSamples.java @@ -0,0 +1,21 @@ +// 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; + +/** Samples for RoleDefinitions GetById. */ +public final class RoleDefinitionsGetByIdSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-05-01-preview/examples/GetRoleDefinitionByRoleId.json + */ + /** + * Sample code: Get role definition by role ID. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleDefinitionByRoleID( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager.roleDefinitions().getByIdWithResponse("roleDefinitionId", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleDefinitionsGetSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleDefinitionsGetSamples.java new file mode 100644 index 000000000000..6ab61da0d5eb --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleDefinitionsGetSamples.java @@ -0,0 +1,21 @@ +// 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; + +/** Samples for RoleDefinitions Get. */ +public final class RoleDefinitionsGetSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-05-01-preview/examples/GetRoleDefinitionById.json + */ + /** + * Sample code: Get role definition by id. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleDefinitionById( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager.roleDefinitions().getWithResponse("scope", "roleDefinitionId", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleDefinitionsListSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleDefinitionsListSamples.java new file mode 100644 index 000000000000..312e2ba0b80e --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleDefinitionsListSamples.java @@ -0,0 +1,21 @@ +// 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; + +/** Samples for RoleDefinitions List. */ +public final class RoleDefinitionsListSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-05-01-preview/examples/GetRoleDefinitionAtScope.json + */ + /** + * Sample code: List role definitions for scope. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void listRoleDefinitionsForScope( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager.roleDefinitions().list("scope", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleEligibilityScheduleInstancesGetSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleEligibilityScheduleInstancesGetSamples.java new file mode 100644 index 000000000000..f1612610d2b2 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleEligibilityScheduleInstancesGetSamples.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; + +/** Samples for RoleEligibilityScheduleInstances Get. */ +public final class RoleEligibilityScheduleInstancesGetSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/examples/GetRoleEligibilityScheduleInstanceByName.json + */ + /** + * Sample code: GetRoleEligibilityScheduleInstanceByName. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleEligibilityScheduleInstanceByName( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleEligibilityScheduleInstances() + .getWithResponse( + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "21e4b59a-0499-4fe0-a3c3-43a3055b773a", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleEligibilityScheduleInstancesListForScopeSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleEligibilityScheduleInstancesListForScopeSamples.java new file mode 100644 index 000000000000..a85085ed3109 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleEligibilityScheduleInstancesListForScopeSamples.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; + +/** Samples for RoleEligibilityScheduleInstances ListForScope. */ +public final class RoleEligibilityScheduleInstancesListForScopeSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/examples/GetRoleEligibilityScheduleInstancesByScope.json + */ + /** + * Sample code: GetRoleEligibilityScheduleInstancesByScope. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleEligibilityScheduleInstancesByScope( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleEligibilityScheduleInstances() + .listForScope( + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "assignedTo('a3bb8764-cb92-4276-9d2a-ca1e895e55ea')", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleEligibilityScheduleRequestsCancelSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleEligibilityScheduleRequestsCancelSamples.java new file mode 100644 index 000000000000..41399b8e4bae --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleEligibilityScheduleRequestsCancelSamples.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; + +/** Samples for RoleEligibilityScheduleRequests Cancel. */ +public final class RoleEligibilityScheduleRequestsCancelSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-04-01-preview/examples/CancelRoleEligibilityScheduleRequestByName.json + */ + /** + * Sample code: CancelRoleEligibilityScheduleRequestByName. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void cancelRoleEligibilityScheduleRequestByName( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleEligibilityScheduleRequests() + .cancelWithResponse( + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "64caffb6-55c0-4deb-a585-68e948ea1ad6", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleEligibilityScheduleRequestsCreateSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleEligibilityScheduleRequestsCreateSamples.java new file mode 100644 index 000000000000..b9acaf7ff436 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleEligibilityScheduleRequestsCreateSamples.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.generated; + +import com.azure.resourcemanager.authorization.generated.models.RequestType; +import com.azure.resourcemanager.authorization.generated.models.RoleEligibilityScheduleRequestPropertiesScheduleInfo; +import com.azure.resourcemanager.authorization.generated.models.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration; +import com.azure.resourcemanager.authorization.generated.models.Type; +import java.time.OffsetDateTime; + +/** Samples for RoleEligibilityScheduleRequests Create. */ +public final class RoleEligibilityScheduleRequestsCreateSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-04-01-preview/examples/PutRoleEligibilityScheduleRequest.json + */ + /** + * Sample code: PutRoleEligibilityScheduleRequest. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void putRoleEligibilityScheduleRequest( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleEligibilityScheduleRequests() + .define("64caffb6-55c0-4deb-a585-68e948ea1ad6") + .withExistingScope("providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f") + .withRoleDefinitionId( + "/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f/providers/Microsoft.Authorization/roleDefinitions/c8d4ff99-41c3-41a8-9f60-21dfdad59608") + .withPrincipalId("a3bb8764-cb92-4276-9d2a-ca1e895e55ea") + .withRequestType(RequestType.ADMIN_ASSIGN) + .withScheduleInfo( + new RoleEligibilityScheduleRequestPropertiesScheduleInfo() + .withStartDateTime(OffsetDateTime.parse("2020-09-09T21:31:27.91Z")) + .withExpiration( + new RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration() + .withType(Type.AFTER_DURATION) + .withDuration("P365D"))) + .withCondition( + "@Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName]" + + " StringEqualsIgnoreCase 'foo_storage_container'") + .withConditionVersion("1.0") + .create(); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleEligibilityScheduleRequestsGetSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleEligibilityScheduleRequestsGetSamples.java new file mode 100644 index 000000000000..f5f2d0296d4d --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleEligibilityScheduleRequestsGetSamples.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; + +/** Samples for RoleEligibilityScheduleRequests Get. */ +public final class RoleEligibilityScheduleRequestsGetSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-04-01-preview/examples/GetRoleEligibilityScheduleRequestByName.json + */ + /** + * Sample code: GetRoleEligibilityScheduleRequestByName. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleEligibilityScheduleRequestByName( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleEligibilityScheduleRequests() + .getWithResponse( + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "64caffb6-55c0-4deb-a585-68e948ea1ad6", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleEligibilityScheduleRequestsListForScopeSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleEligibilityScheduleRequestsListForScopeSamples.java new file mode 100644 index 000000000000..39348ce5011f --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleEligibilityScheduleRequestsListForScopeSamples.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; + +/** Samples for RoleEligibilityScheduleRequests ListForScope. */ +public final class RoleEligibilityScheduleRequestsListForScopeSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-04-01-preview/examples/GetRoleEligibilityScheduleRequestByScope.json + */ + /** + * Sample code: GetRoleEligibilityScheduleRequestByScope. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleEligibilityScheduleRequestByScope( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleEligibilityScheduleRequests() + .listForScope( + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "assignedTo('A3BB8764-CB92-4276-9D2A-CA1E895E55EA')", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleEligibilityScheduleRequestsValidateSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleEligibilityScheduleRequestsValidateSamples.java new file mode 100644 index 000000000000..9af23741741a --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleEligibilityScheduleRequestsValidateSamples.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.generated; + +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleEligibilityScheduleRequestInner; +import com.azure.resourcemanager.authorization.generated.models.RequestType; +import com.azure.resourcemanager.authorization.generated.models.RoleEligibilityScheduleRequestPropertiesScheduleInfo; +import com.azure.resourcemanager.authorization.generated.models.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration; +import com.azure.resourcemanager.authorization.generated.models.Type; +import java.time.OffsetDateTime; + +/** Samples for RoleEligibilityScheduleRequests Validate. */ +public final class RoleEligibilityScheduleRequestsValidateSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2022-04-01-preview/examples/ValidateRoleEligibilityScheduleRequestByName.json + */ + /** + * Sample code: ValidateRoleEligibilityScheduleRequestByName. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void validateRoleEligibilityScheduleRequestByName( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleEligibilityScheduleRequests() + .validateWithResponse( + "subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "64caffb6-55c0-4deb-a585-68e948ea1ad6", + new RoleEligibilityScheduleRequestInner() + .withRoleDefinitionId( + "/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f/providers/Microsoft.Authorization/roleDefinitions/c8d4ff99-41c3-41a8-9f60-21dfdad59608") + .withPrincipalId("a3bb8764-cb92-4276-9d2a-ca1e895e55ea") + .withRequestType(RequestType.ADMIN_ASSIGN) + .withScheduleInfo( + new RoleEligibilityScheduleRequestPropertiesScheduleInfo() + .withStartDateTime(OffsetDateTime.parse("2020-09-09T21:31:27.91Z")) + .withExpiration( + new RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration() + .withType(Type.AFTER_DURATION) + .withDuration("P365D"))) + .withCondition( + "@Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName]" + + " StringEqualsIgnoreCase 'foo_storage_container'") + .withConditionVersion("1.0"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleEligibilitySchedulesGetSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleEligibilitySchedulesGetSamples.java new file mode 100644 index 000000000000..214eeefe3131 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleEligibilitySchedulesGetSamples.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; + +/** Samples for RoleEligibilitySchedules Get. */ +public final class RoleEligibilitySchedulesGetSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/examples/GetRoleEligibilityScheduleByName.json + */ + /** + * Sample code: GetRoleEligibilityScheduleByName. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleEligibilityScheduleByName( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleEligibilitySchedules() + .getWithResponse( + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "b1477448-2cc6-4ceb-93b4-54a202a89413", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleEligibilitySchedulesListForScopeSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleEligibilitySchedulesListForScopeSamples.java new file mode 100644 index 000000000000..bfc2d1aebaf4 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleEligibilitySchedulesListForScopeSamples.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; + +/** Samples for RoleEligibilitySchedules ListForScope. */ +public final class RoleEligibilitySchedulesListForScopeSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/examples/GetRoleEligibilitySchedulesByScope.json + */ + /** + * Sample code: GetRoleEligibilitySchedulesByScope. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleEligibilitySchedulesByScope( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleEligibilitySchedules() + .listForScope( + "providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "assignedTo('a3bb8764-cb92-4276-9d2a-ca1e895e55ea')", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleManagementPoliciesDeleteSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleManagementPoliciesDeleteSamples.java new file mode 100644 index 000000000000..7ed3b67f9beb --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleManagementPoliciesDeleteSamples.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; + +/** Samples for RoleManagementPolicies Delete. */ +public final class RoleManagementPoliciesDeleteSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/examples/DeleteRoleManagementPolicy.json + */ + /** + * Sample code: DeleteRoleManagementPolicy. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void deleteRoleManagementPolicy( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleManagementPolicies() + .deleteByResourceGroupWithResponse( + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368", + "570c3619-7688-4b34-b290-2b8bb3ccab2a", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleManagementPoliciesGetSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleManagementPoliciesGetSamples.java new file mode 100644 index 000000000000..60dab10b1648 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleManagementPoliciesGetSamples.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; + +/** Samples for RoleManagementPolicies Get. */ +public final class RoleManagementPoliciesGetSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/examples/GetRoleManagementPolicyByName.json + */ + /** + * Sample code: GetRoleManagementPolicyByName. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleManagementPolicyByName( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleManagementPolicies() + .getWithResponse( + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368", + "570c3619-7688-4b34-b290-2b8bb3ccab2a", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleManagementPoliciesListForScopeSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleManagementPoliciesListForScopeSamples.java new file mode 100644 index 000000000000..6b7d60c6f48d --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleManagementPoliciesListForScopeSamples.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; + +/** Samples for RoleManagementPolicies ListForScope. */ +public final class RoleManagementPoliciesListForScopeSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/examples/GetRoleManagementPolicyByScope.json + */ + /** + * Sample code: GetRoleManagementPolicyByRoleDefinitionFilter. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleManagementPolicyByRoleDefinitionFilter( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleManagementPolicies() + .listForScope( + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleManagementPoliciesUpdateSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleManagementPoliciesUpdateSamples.java new file mode 100644 index 000000000000..d7a225e0faf1 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleManagementPoliciesUpdateSamples.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.generated; + +import com.azure.resourcemanager.authorization.generated.fluent.models.RoleManagementPolicyInner; +import com.azure.resourcemanager.authorization.generated.models.ApprovalMode; +import com.azure.resourcemanager.authorization.generated.models.ApprovalSettings; +import com.azure.resourcemanager.authorization.generated.models.ApprovalStage; +import com.azure.resourcemanager.authorization.generated.models.EnablementRules; +import com.azure.resourcemanager.authorization.generated.models.NotificationDeliveryMechanism; +import com.azure.resourcemanager.authorization.generated.models.NotificationLevel; +import com.azure.resourcemanager.authorization.generated.models.RecipientType; +import com.azure.resourcemanager.authorization.generated.models.RoleManagementPolicyApprovalRule; +import com.azure.resourcemanager.authorization.generated.models.RoleManagementPolicyAuthenticationContextRule; +import com.azure.resourcemanager.authorization.generated.models.RoleManagementPolicyEnablementRule; +import com.azure.resourcemanager.authorization.generated.models.RoleManagementPolicyExpirationRule; +import com.azure.resourcemanager.authorization.generated.models.RoleManagementPolicyNotificationRule; +import com.azure.resourcemanager.authorization.generated.models.RoleManagementPolicyRuleTarget; +import com.azure.resourcemanager.authorization.generated.models.UserSet; +import com.azure.resourcemanager.authorization.generated.models.UserType; +import java.util.Arrays; + +/** Samples for RoleManagementPolicies Update. */ +public final class RoleManagementPoliciesUpdateSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/examples/PatchPartialRoleManagementPolicy.json + */ + /** + * Sample code: PatchPartialRoleManagementPolicy. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void patchPartialRoleManagementPolicy( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleManagementPolicies() + .updateWithResponse( + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368", + "570c3619-7688-4b34-b290-2b8bb3ccab2a", + new RoleManagementPolicyInner() + .withRules( + Arrays + .asList( + new RoleManagementPolicyExpirationRule() + .withId("Expiration_Admin_Eligibility") + .withTarget( + new RoleManagementPolicyRuleTarget() + .withCaller("Admin") + .withOperations(Arrays.asList("All")) + .withLevel("Eligibility")) + .withIsExpirationRequired(false) + .withMaximumDuration("P180D"), + new RoleManagementPolicyNotificationRule() + .withId("Notification_Admin_Admin_Eligibility") + .withTarget( + new RoleManagementPolicyRuleTarget() + .withCaller("Admin") + .withOperations(Arrays.asList("All")) + .withLevel("Eligibility")) + .withNotificationType(NotificationDeliveryMechanism.EMAIL) + .withNotificationLevel(NotificationLevel.CRITICAL) + .withRecipientType(RecipientType.ADMIN) + .withNotificationRecipients(Arrays.asList("admin_admin_eligible@test.com")) + .withIsDefaultRecipientsEnabled(false))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/examples/PatchRoleManagementPolicy.json + */ + /** + * Sample code: PatchRoleManagementPolicy. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void patchRoleManagementPolicy( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleManagementPolicies() + .updateWithResponse( + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368", + "570c3619-7688-4b34-b290-2b8bb3ccab2a", + new RoleManagementPolicyInner() + .withRules( + Arrays + .asList( + new RoleManagementPolicyExpirationRule() + .withId("Expiration_Admin_Eligibility") + .withTarget( + new RoleManagementPolicyRuleTarget() + .withCaller("Admin") + .withOperations(Arrays.asList("All")) + .withLevel("Eligibility")) + .withIsExpirationRequired(false) + .withMaximumDuration("P180D"), + new RoleManagementPolicyNotificationRule() + .withId("Notification_Admin_Admin_Eligibility") + .withTarget( + new RoleManagementPolicyRuleTarget() + .withCaller("Admin") + .withOperations(Arrays.asList("All")) + .withLevel("Eligibility")) + .withNotificationType(NotificationDeliveryMechanism.EMAIL) + .withNotificationLevel(NotificationLevel.CRITICAL) + .withRecipientType(RecipientType.ADMIN) + .withNotificationRecipients(Arrays.asList("admin_admin_eligible@test.com")) + .withIsDefaultRecipientsEnabled(false), + new RoleManagementPolicyNotificationRule() + .withId("Notification_Requestor_Admin_Eligibility") + .withTarget( + new RoleManagementPolicyRuleTarget() + .withCaller("Admin") + .withOperations(Arrays.asList("All")) + .withLevel("Eligibility")) + .withNotificationType(NotificationDeliveryMechanism.EMAIL) + .withNotificationLevel(NotificationLevel.CRITICAL) + .withRecipientType(RecipientType.REQUESTOR) + .withNotificationRecipients(Arrays.asList("requestor_admin_eligible@test.com")) + .withIsDefaultRecipientsEnabled(false), + new RoleManagementPolicyNotificationRule() + .withId("Notification_Approver_Admin_Eligibility") + .withTarget( + new RoleManagementPolicyRuleTarget() + .withCaller("Admin") + .withOperations(Arrays.asList("All")) + .withLevel("Eligibility")) + .withNotificationType(NotificationDeliveryMechanism.EMAIL) + .withNotificationLevel(NotificationLevel.CRITICAL) + .withRecipientType(RecipientType.APPROVER) + .withNotificationRecipients(Arrays.asList("approver_admin_eligible@test.com")) + .withIsDefaultRecipientsEnabled(false), + new RoleManagementPolicyEnablementRule() + .withId("Enablement_Admin_Eligibility") + .withTarget( + new RoleManagementPolicyRuleTarget() + .withCaller("Admin") + .withOperations(Arrays.asList("All")) + .withLevel("Eligibility")) + .withEnabledRules(Arrays.asList()), + new RoleManagementPolicyExpirationRule() + .withId("Expiration_Admin_Assignment") + .withTarget( + new RoleManagementPolicyRuleTarget() + .withCaller("Admin") + .withOperations(Arrays.asList("All")) + .withLevel("Assignment")) + .withIsExpirationRequired(false) + .withMaximumDuration("P90D"), + new RoleManagementPolicyEnablementRule() + .withId("Enablement_Admin_Assignment") + .withTarget( + new RoleManagementPolicyRuleTarget() + .withCaller("Admin") + .withOperations(Arrays.asList("All")) + .withLevel("Assignment")) + .withEnabledRules( + Arrays + .asList( + EnablementRules.JUSTIFICATION, + EnablementRules.MULTI_FACTOR_AUTHENTICATION)), + new RoleManagementPolicyNotificationRule() + .withId("Notification_Admin_Admin_Assignment") + .withTarget( + new RoleManagementPolicyRuleTarget() + .withCaller("Admin") + .withOperations(Arrays.asList("All")) + .withLevel("Assignment")) + .withNotificationType(NotificationDeliveryMechanism.EMAIL) + .withNotificationLevel(NotificationLevel.CRITICAL) + .withRecipientType(RecipientType.ADMIN) + .withNotificationRecipients(Arrays.asList("admin_admin_member@test.com")) + .withIsDefaultRecipientsEnabled(false), + new RoleManagementPolicyNotificationRule() + .withId("Notification_Requestor_Admin_Assignment") + .withTarget( + new RoleManagementPolicyRuleTarget() + .withCaller("Admin") + .withOperations(Arrays.asList("All")) + .withLevel("Assignment")) + .withNotificationType(NotificationDeliveryMechanism.EMAIL) + .withNotificationLevel(NotificationLevel.CRITICAL) + .withRecipientType(RecipientType.REQUESTOR) + .withNotificationRecipients(Arrays.asList("requestor_admin_member@test.com")) + .withIsDefaultRecipientsEnabled(false), + new RoleManagementPolicyNotificationRule() + .withId("Notification_Approver_Admin_Assignment") + .withTarget( + new RoleManagementPolicyRuleTarget() + .withCaller("Admin") + .withOperations(Arrays.asList("All")) + .withLevel("Assignment")) + .withNotificationType(NotificationDeliveryMechanism.EMAIL) + .withNotificationLevel(NotificationLevel.CRITICAL) + .withRecipientType(RecipientType.APPROVER) + .withNotificationRecipients(Arrays.asList("approver_admin_member@test.com")) + .withIsDefaultRecipientsEnabled(false), + new RoleManagementPolicyExpirationRule() + .withId("Expiration_EndUser_Assignment") + .withTarget( + new RoleManagementPolicyRuleTarget() + .withCaller("EndUser") + .withOperations(Arrays.asList("All")) + .withLevel("Assignment")) + .withIsExpirationRequired(true) + .withMaximumDuration("PT7H"), + new RoleManagementPolicyEnablementRule() + .withId("Enablement_EndUser_Assignment") + .withTarget( + new RoleManagementPolicyRuleTarget() + .withCaller("EndUser") + .withOperations(Arrays.asList("All")) + .withLevel("Assignment")) + .withEnabledRules( + Arrays + .asList( + EnablementRules.JUSTIFICATION, + EnablementRules.MULTI_FACTOR_AUTHENTICATION, + EnablementRules.TICKETING)), + new RoleManagementPolicyApprovalRule() + .withId("Approval_EndUser_Assignment") + .withTarget( + new RoleManagementPolicyRuleTarget() + .withCaller("EndUser") + .withOperations(Arrays.asList("All")) + .withLevel("Assignment")) + .withSetting( + new ApprovalSettings() + .withIsApprovalRequired(true) + .withIsApprovalRequiredForExtension(false) + .withIsRequestorJustificationRequired(true) + .withApprovalMode(ApprovalMode.SINGLE_STAGE) + .withApprovalStages( + Arrays + .asList( + new ApprovalStage() + .withApprovalStageTimeOutInDays(1) + .withIsApproverJustificationRequired(true) + .withEscalationTimeInMinutes(0) + .withPrimaryApprovers( + Arrays + .asList( + new UserSet() + .withUserType(UserType.GROUP) + .withIsBackup(false) + .withId( + "2385b0f3-5fa9-43cf-8ca4-b01dc97298cd") + .withDescription("amansw_new_group"), + new UserSet() + .withUserType(UserType.GROUP) + .withIsBackup(false) + .withId( + "2f4913c9-d15b-406a-9946-1d66a28f2690") + .withDescription("amansw_group"))) + .withIsEscalationEnabled(false)))), + new RoleManagementPolicyAuthenticationContextRule() + .withId("AuthenticationContext_EndUser_Assignment") + .withTarget( + new RoleManagementPolicyRuleTarget() + .withCaller("EndUser") + .withOperations(Arrays.asList("All")) + .withLevel("Assignment")) + .withIsEnabled(false) + .withClaimValue(""), + new RoleManagementPolicyNotificationRule() + .withId("Notification_Admin_EndUser_Assignment") + .withTarget( + new RoleManagementPolicyRuleTarget() + .withCaller("EndUser") + .withOperations(Arrays.asList("All")) + .withLevel("Assignment")) + .withNotificationType(NotificationDeliveryMechanism.EMAIL) + .withNotificationLevel(NotificationLevel.CRITICAL) + .withRecipientType(RecipientType.ADMIN) + .withNotificationRecipients(Arrays.asList("admin_enduser_member@test.com")) + .withIsDefaultRecipientsEnabled(false), + new RoleManagementPolicyNotificationRule() + .withId("Notification_Requestor_EndUser_Assignment") + .withTarget( + new RoleManagementPolicyRuleTarget() + .withCaller("EndUser") + .withOperations(Arrays.asList("All")) + .withLevel("Assignment")) + .withNotificationType(NotificationDeliveryMechanism.EMAIL) + .withNotificationLevel(NotificationLevel.CRITICAL) + .withRecipientType(RecipientType.REQUESTOR) + .withNotificationRecipients(Arrays.asList("requestor_enduser_member@test.com")) + .withIsDefaultRecipientsEnabled(false), + new RoleManagementPolicyNotificationRule() + .withId("Notification_Approver_EndUser_Assignment") + .withTarget( + new RoleManagementPolicyRuleTarget() + .withCaller("EndUser") + .withOperations(Arrays.asList("All")) + .withLevel("Assignment")) + .withNotificationType(NotificationDeliveryMechanism.EMAIL) + .withNotificationLevel(NotificationLevel.CRITICAL) + .withRecipientType(RecipientType.APPROVER) + .withIsDefaultRecipientsEnabled(true))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleManagementPolicyAssignmentsCreateSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleManagementPolicyAssignmentsCreateSamples.java new file mode 100644 index 000000000000..575830f97e6b --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleManagementPolicyAssignmentsCreateSamples.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; + +/** Samples for RoleManagementPolicyAssignments Create. */ +public final class RoleManagementPolicyAssignmentsCreateSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/examples/PutRoleManagementPolicyAssignment.json + */ + /** + * Sample code: PutRoleManagementPolicyAssignment. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void putRoleManagementPolicyAssignment( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleManagementPolicyAssignments() + .define("b959d571-f0b5-4042-88a7-01be6cb22db9_a1705bd2-3a8f-45a5-8683-466fcfd5cc24") + .withExistingScope("providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368") + .withScope("/subscriptions/129ff972-28f8-46b8-a726-e497be039368") + .withRoleDefinitionId( + "/subscriptions/129ff972-28f8-46b8-a726-e497be039368/providers/Microsoft.Authorization/roleDefinitions/a1705bd2-3a8f-45a5-8683-466fcfd5cc24") + .withPolicyId( + "/providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368/providers/Microsoft.Authorization/roleManagementPolicies/b959d571-f0b5-4042-88a7-01be6cb22db9") + .create(); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleManagementPolicyAssignmentsDeleteSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleManagementPolicyAssignmentsDeleteSamples.java new file mode 100644 index 000000000000..721cf659b03d --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleManagementPolicyAssignmentsDeleteSamples.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; + +/** Samples for RoleManagementPolicyAssignments Delete. */ +public final class RoleManagementPolicyAssignmentsDeleteSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/examples/DeleteRoleManagementPolicyAssignment.json + */ + /** + * Sample code: DeleteRoleManagementPolicyAssignment. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void deleteRoleManagementPolicyAssignment( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleManagementPolicyAssignments() + .deleteByResourceGroupWithResponse( + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368", + "b959d571-f0b5-4042-88a7-01be6cb22db9_a1705bd2-3a8f-45a5-8683-466fcfd5cc24", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleManagementPolicyAssignmentsGetSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleManagementPolicyAssignmentsGetSamples.java new file mode 100644 index 000000000000..188c9e956631 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleManagementPolicyAssignmentsGetSamples.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; + +/** Samples for RoleManagementPolicyAssignments Get. */ +public final class RoleManagementPolicyAssignmentsGetSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/examples/GetRoleManagementPolicyAssignmentByName.json + */ + /** + * Sample code: GetConfigurations. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getConfigurations( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleManagementPolicyAssignments() + .getWithResponse( + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368", + "b959d571-f0b5-4042-88a7-01be6cb22db9_a1705bd2-3a8f-45a5-8683-466fcfd5cc24", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleManagementPolicyAssignmentsListForScopeSamples.java b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleManagementPolicyAssignmentsListForScopeSamples.java new file mode 100644 index 000000000000..3f6fad763700 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/RoleManagementPolicyAssignmentsListForScopeSamples.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; + +/** Samples for RoleManagementPolicyAssignments ListForScope. */ +public final class RoleManagementPolicyAssignmentsListForScopeSamples { + /* + * x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-10-01-preview/examples/GetRoleManagementPolicyAssignmentByScope.json + */ + /** + * Sample code: GetRoleManagementPolicyAssignmentByScope. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleManagementPolicyAssignmentByScope( + com.azure.resourcemanager.authorization.generated.AuthorizationManager manager) { + manager + .roleManagementPolicyAssignments() + .listForScope( + "providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368", + com.azure.core.util.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 000000000000..e5ca7cebf14e --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewDefaultSettingsGetSamples.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; + +/** 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", com.azure.core.util.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 000000000000..356975980b4a --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewDefaultSettingsPutSamples.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.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(), + com.azure.core.util.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 000000000000..da06e44e743a --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewHistoryDefinitionInstanceGenerateDownloadUriSamples.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; + +/** 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", + com.azure.core.util.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 000000000000..e651d89188cb --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewHistoryDefinitionInstancesOperationListSamples.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; + +/** 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", + com.azure.core.util.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 000000000000..6430c8c9c469 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewHistoryDefinitionOperationCreateSamples.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.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(), + com.azure.core.util.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 000000000000..a13df058bd1a --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewHistoryDefinitionOperationDeleteByIdSamples.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; + +/** 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", + com.azure.core.util.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 000000000000..69890d7eb16f --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewHistoryDefinitionsGetByIdSamples.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; + +/** 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", + com.azure.core.util.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 000000000000..3f609bbe6593 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewHistoryDefinitionsListSamples.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; + +/** 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, com.azure.core.util.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 000000000000..ecb89a147903 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstanceContactedReviewersListSamples.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; + +/** 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", + com.azure.core.util.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 000000000000..852520421b37 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstanceDecisionsListSamples.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; + +/** 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, + com.azure.core.util.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 000000000000..9731bc83517a --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstanceOperationApplyDecisionsSamples.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; + +/** 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", + com.azure.core.util.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 000000000000..38e2b28dded6 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstanceOperationRecordAllDecisionsSamples.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.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(), + com.azure.core.util.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 000000000000..e6bebd0bfd39 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstanceOperationResetDecisionsSamples.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; + +/** 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", + com.azure.core.util.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 000000000000..70608277bc6d --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstanceOperationSendRemindersSamples.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; + +/** 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", + com.azure.core.util.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 000000000000..fa0055dff173 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstanceOperationStopSamples.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; + +/** 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", + com.azure.core.util.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 000000000000..4e7d9f954a87 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstancesCreateSamples.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.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(), + com.azure.core.util.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 000000000000..4fbbc92fedeb --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstancesGetByIdSamples.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; + +/** 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", + com.azure.core.util.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 000000000000..927e481395af --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewInstancesListSamples.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; + +/** 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, + com.azure.core.util.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 000000000000..41deae23b2e7 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewScheduleDefinitionsCreateOrUpdateByIdSamples.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.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(), + com.azure.core.util.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 000000000000..772cebc84ade --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewScheduleDefinitionsDeleteByIdSamples.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; + +/** 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", + com.azure.core.util.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 000000000000..5c4983c5dbc1 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewScheduleDefinitionsGetByIdSamples.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; + +/** 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", + com.azure.core.util.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 000000000000..3bb3908909ca --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewScheduleDefinitionsListSamples.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; + +/** 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, com.azure.core.util.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 000000000000..768d6507ac63 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/ScopeAccessReviewScheduleDefinitionsStopSamples.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; + +/** 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", + com.azure.core.util.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 000000000000..32459672bf81 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization-generated/src/samples/java/com/azure/resourcemanager/authorization/generated/generated/TenantLevelAccessReviewInstanceContactedReviewersListSamples.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; + +/** 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", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/ci.yml b/sdk/authorization/ci.yml new file mode 100644 index 000000000000..eb62b2724b50 --- /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 000000000000..ac027b696deb --- /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 + +